Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
travjenkins committed Nov 9, 2023
1 parent 90da169 commit cf50548
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/services/supabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,24 +214,20 @@ export interface CallSupabaseResponse<T> {
data: T | null;
}

export const handleSuccess = <T>(response: any) => {
return response.error
export const handleSuccess = <T>(response: any) =>
response.error
? {
data: null,
error: response.error,
}
: {
data: response.data as T,
};
};

export const handleFailure = (error: any) => {
console.log('handleFailue', error);
return {
data: null,
error,
};
};
export const handleFailure = (error: any) => ({
data: null,
error,
});

// Retry calls
const RETRY_ATTEMPTS = 2;
Expand Down

0 comments on commit cf50548

Please sign in to comment.