From edcdeead7c365d0d2605dac0e0df0a1539765d9f Mon Sep 17 00:00:00 2001 From: Leonardo Custodio Date: Sat, 12 Aug 2023 17:15:03 -0300 Subject: [PATCH] a few changes --- resources/js/api/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/js/api/index.ts b/resources/js/api/index.ts index b5d659d..715a86c 100644 --- a/resources/js/api/index.ts +++ b/resources/js/api/index.ts @@ -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();