Linking backend data to frontend
This commit is contained in:
@@ -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}`
|
||||
|
||||
// всегда вызываем оба хука
|
||||
|
||||
Reference in New Issue
Block a user