From 00710964838d62d2d5564f954275bfb5d2fcfcfd Mon Sep 17 00:00:00 2001 From: moonlitgrace Date: Mon, 9 Dec 2024 16:12:21 +0530 Subject: [PATCH] refactor: move errors to /utils dir --- frontend/src/lib/utils/api.ts | 2 +- frontend/src/lib/{errors/auth.ts => utils/errors.ts} | 0 frontend/src/routes/auth/+page.server.ts | 2 +- frontend/src/routes/settings/profile/+page.server.ts | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename frontend/src/lib/{errors/auth.ts => utils/errors.ts} (100%) diff --git a/frontend/src/lib/utils/api.ts b/frontend/src/lib/utils/api.ts index 6eb42f8..2b8d68f 100644 --- a/frontend/src/lib/utils/api.ts +++ b/frontend/src/lib/utils/api.ts @@ -1,5 +1,5 @@ import { PUBLIC_API_URL } from '$env/static/public'; -import { AuthError } from '$lib/errors/auth'; +import { AuthError } from '$lib/utils/errors'; /** * A utility function to make API requests. diff --git a/frontend/src/lib/errors/auth.ts b/frontend/src/lib/utils/errors.ts similarity index 100% rename from frontend/src/lib/errors/auth.ts rename to frontend/src/lib/utils/errors.ts diff --git a/frontend/src/routes/auth/+page.server.ts b/frontend/src/routes/auth/+page.server.ts index b672e9a..928a364 100644 --- a/frontend/src/routes/auth/+page.server.ts +++ b/frontend/src/routes/auth/+page.server.ts @@ -2,7 +2,7 @@ import { dev } from '$app/environment'; import { fail } from '@sveltejs/kit'; import type { Actions } from './$types'; import { apiFetch } from '$lib/utils/api'; -import { isAuthError } from '$lib/errors/auth'; +import { isAuthError } from '$lib/utils/errors'; export const actions = { login: async ({ request, cookies }) => { diff --git a/frontend/src/routes/settings/profile/+page.server.ts b/frontend/src/routes/settings/profile/+page.server.ts index 18c557b..e62fc1e 100644 --- a/frontend/src/routes/settings/profile/+page.server.ts +++ b/frontend/src/routes/settings/profile/+page.server.ts @@ -1,4 +1,4 @@ -import { isAuthError } from '$lib/errors/auth'; +import { isAuthError } from '$lib/utils/errors'; import { apiFetch } from '$lib/utils/api'; import { fail } from '@sveltejs/kit'; import type { Actions } from './$types';