Linking backend data to frontend

This commit is contained in:
iv_vuytsik
2025-10-15 19:49:19 +03:00
parent ea1f50c1b8
commit 2b19ed246b
28 changed files with 959 additions and 385 deletions

View File

@@ -32,7 +32,7 @@ export function useClientFetch<TData = unknown, TVariables = void, TError = Axio
: MutationResult<TData, TVariables, TError> {
const { method = 'GET', config = {}, queryOptions = {}, mutationOptions = {} } = options
const API_URL = process.env.NEXT_PUBLIC_API_URL
const API_URL = process.env.NEXT_PUBLIC_API_URL ?? `${window.location.origin}/api/v1`
const fullUrl = url.startsWith('http') ? url : `${API_URL}${url}`
// всегда вызываем оба хука