Skip to content

Commit

Permalink
a few changes
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardocustodio committed Aug 12, 2023
1 parent c44d865 commit edcdeea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/js/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ export class ApiService {
if (resp.status === 401) {
useAppStore().clearLogin();
snackbar.error({ title: 'Unauthorized', text: 'Session expired, try to sign in again' });
throw [{ field: 'Error', message: 'Unauthorized' }];
return [{ field: 'Error', message: 'Unauthorized' }];
}

if (resp.status >= 400 && resp.status < 600) {
throw resp as unknown as Error;
return resp as unknown as Error;
}

return resp.json();
Expand Down

0 comments on commit edcdeea

Please sign in to comment.