19 lines
506 B
TypeScript
19 lines
506 B
TypeScript
'use client';
|
|
|
|
import { getService, getServices } from '@/actions/api/services';
|
|
import { useQuery } from '@tanstack/react-query';
|
|
|
|
export const useServicesQuery = (input: Parameters<typeof getServices>[0]) => {
|
|
return useQuery({
|
|
queryFn: () => getServices(input),
|
|
queryKey: ['services', input],
|
|
});
|
|
};
|
|
|
|
export const useServiceQuery = (input: Parameters<typeof getService>[0]) => {
|
|
return useQuery({
|
|
queryFn: () => getService(input),
|
|
queryKey: ['service', input.documentId],
|
|
});
|
|
};
|