fix architecture and write new tests

This commit is contained in:
root
2026-06-10 00:40:19 -04:00
parent 560da1cadf
commit 80a597bc10
377 changed files with 84020 additions and 1337 deletions
+2 -2
View File
@@ -3,10 +3,10 @@ export const ADMIN_API_BASE =
? (process.env.API_INTERNAL_URL ?? process.env.NEXT_PUBLIC_API_URL ?? 'http://localhost:4000/api/v1')
: (process.env.NEXT_PUBLIC_API_URL ?? '/admin/api/v1')
export async function adminFetch<T>(path: string, token?: string): Promise<T> {
export async function adminFetch<T>(path: string, _token?: string): Promise<T> {
const res = await fetch(`${ADMIN_API_BASE}${path}`, {
cache: 'no-store',
headers: token ? { Authorization: `Bearer ${token}` } : undefined,
credentials: 'include',
})
const json = await res.json()
if (!res.ok) throw new Error(json?.message ?? 'Request failed')