From 3fda81563480fc0001ec9dde8e1e2c66a7a47658 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Sat, 3 Sep 2022 22:19:19 -0800 Subject: [PATCH] logger --- frontend/composables/use-api.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/frontend/composables/use-api.ts b/frontend/composables/use-api.ts index d80dec7..87be12c 100644 --- a/frontend/composables/use-api.ts +++ b/frontend/composables/use-api.ts @@ -3,12 +3,8 @@ import { UserApi } from '~~/lib/api/user'; import { Requests } from '~~/lib/requests'; import { useAuthStore } from '~~/stores/auth'; -function ApiDebugger(r: Response) { - console.table({ - 'Request Url': r.url, - 'Response Status': r.status, - 'Response Status Text': r.statusText, - }); +function logger(r: Response) { + console.log(`${r.status} ${r.url} ${r.statusText}`); } export function usePublicApi(): PublicApi { @@ -20,7 +16,7 @@ export function useUserApi(): UserApi { const authStore = useAuthStore(); const requests = new Requests('', () => authStore.token, {}); - requests.addResponseInterceptor(ApiDebugger); + requests.addResponseInterceptor(logger); requests.addResponseInterceptor(r => { if (r.status === 401) { authStore.clearSession();