From 09d02b7cedc4fa0b9a521a4967a4ad53e46bacf7 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Fri, 22 Nov 2024 15:05:27 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A(frontend)=20move=20conf=20api=20ur?= =?UTF-8?q?ls=20to=20api=20folder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previous refacto let only the api urls in the conf file, so better to move it to the api folder. --- src/frontend/apps/impress/src/{core/conf.ts => api/config.ts} | 0 src/frontend/apps/impress/src/api/fetchApi.ts | 3 +-- src/frontend/apps/impress/src/api/index.ts | 1 + src/frontend/apps/impress/src/core/auth/useAuthStore.tsx | 2 +- src/frontend/apps/impress/src/core/index.ts | 1 - 5 files changed, 3 insertions(+), 4 deletions(-) rename src/frontend/apps/impress/src/{core/conf.ts => api/config.ts} (100%) diff --git a/src/frontend/apps/impress/src/core/conf.ts b/src/frontend/apps/impress/src/api/config.ts similarity index 100% rename from src/frontend/apps/impress/src/core/conf.ts rename to src/frontend/apps/impress/src/api/config.ts diff --git a/src/frontend/apps/impress/src/api/fetchApi.ts b/src/frontend/apps/impress/src/api/fetchApi.ts index 208f5e819..24e6b319e 100644 --- a/src/frontend/apps/impress/src/api/fetchApi.ts +++ b/src/frontend/apps/impress/src/api/fetchApi.ts @@ -1,5 +1,4 @@ -import { baseApiUrl } from '@/core'; - +import { baseApiUrl } from './config'; import { getCSRFToken } from './utils'; interface FetchAPIInit extends RequestInit { diff --git a/src/frontend/apps/impress/src/api/index.ts b/src/frontend/apps/impress/src/api/index.ts index 331566655..1d742adb8 100644 --- a/src/frontend/apps/impress/src/api/index.ts +++ b/src/frontend/apps/impress/src/api/index.ts @@ -1,4 +1,5 @@ export * from './APIError'; +export * from './config'; export * from './fetchApi'; export * from './helpers'; export * from './types'; diff --git a/src/frontend/apps/impress/src/core/auth/useAuthStore.tsx b/src/frontend/apps/impress/src/core/auth/useAuthStore.tsx index 787e408ac..09283db90 100644 --- a/src/frontend/apps/impress/src/core/auth/useAuthStore.tsx +++ b/src/frontend/apps/impress/src/core/auth/useAuthStore.tsx @@ -1,6 +1,6 @@ import { create } from 'zustand'; -import { baseApiUrl } from '@/core/conf'; +import { baseApiUrl } from '@/api'; import { User, getMe } from './api'; import { PATH_AUTH_LOCAL_STORAGE } from './conf'; diff --git a/src/frontend/apps/impress/src/core/index.ts b/src/frontend/apps/impress/src/core/index.ts index 99176076a..20df7a863 100644 --- a/src/frontend/apps/impress/src/core/index.ts +++ b/src/frontend/apps/impress/src/core/index.ts @@ -1,4 +1,3 @@ export * from './AppProvider'; export * from './auth'; -export * from './conf'; export * from './config';