fix(web): remove prefixos /api/v1 hardcoded nas queries ping e clients
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,7 +27,7 @@ export function useClientList(params: Partial<ClientListQuery> = {}) {
|
|||||||
return useQuery<ClientListResponse, Error>({
|
return useQuery<ClientListResponse, Error>({
|
||||||
queryKey: CLIENT_KEYS.list(params),
|
queryKey: CLIENT_KEYS.list(params),
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const raw = await apiFetch(`/api/v1/clients${query ? `?${query}` : ''}`);
|
const raw = await apiFetch(`/clients${query ? `?${query}` : ''}`);
|
||||||
return ClientListResponseSchema.parse(raw);
|
return ClientListResponseSchema.parse(raw);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -37,7 +37,7 @@ export function useClientDetail(id: string) {
|
|||||||
return useQuery<ClientDetail, Error>({
|
return useQuery<ClientDetail, Error>({
|
||||||
queryKey: CLIENT_KEYS.detail(id),
|
queryKey: CLIENT_KEYS.detail(id),
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const raw = await apiFetch(`/api/v1/clients/${id}`);
|
const raw = await apiFetch(`/clients/${id}`);
|
||||||
return ClientDetailSchema.parse(raw);
|
return ClientDetailSchema.parse(raw);
|
||||||
},
|
},
|
||||||
enabled: !!id,
|
enabled: !!id,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export function useApiPing() {
|
|||||||
return useQuery<PingResponse, Error>({
|
return useQuery<PingResponse, Error>({
|
||||||
queryKey: PING_QUERY_KEY,
|
queryKey: PING_QUERY_KEY,
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const raw = await apiFetch('/api/v1/ping');
|
const raw = await apiFetch('/ping');
|
||||||
return PingResponseSchema.parse(raw);
|
return PingResponseSchema.parse(raw);
|
||||||
},
|
},
|
||||||
refetchInterval: 30_000,
|
refetchInterval: 30_000,
|
||||||
|
|||||||
Reference in New Issue
Block a user