mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 22:58:17 +00:00
feat: finish company profile in the backoffice
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { QUERY_KEYS } from "@/constants/QUERY_KEYS";
|
||||
import { customersService } from "@/services/customers.service";
|
||||
import type { CompanyListFilter } from "@/types/customer";
|
||||
|
||||
export function useCustomerList(filter: CompanyListFilter) {
|
||||
return useQuery({
|
||||
queryKey: QUERY_KEYS.CUSTOMERS.list(filter),
|
||||
queryFn: () => customersService.list(filter),
|
||||
});
|
||||
}
|
||||
|
||||
export function useCustomerDetail(id: string | undefined) {
|
||||
return useQuery({
|
||||
queryKey: QUERY_KEYS.CUSTOMERS.byId(id ?? ""),
|
||||
queryFn: () => customersService.getById(id!),
|
||||
enabled: Boolean(id),
|
||||
});
|
||||
}
|
||||
|
||||
export function useCustomerBookings(id: string | undefined) {
|
||||
return useQuery({
|
||||
queryKey: QUERY_KEYS.CUSTOMERS.bookings(id ?? ""),
|
||||
queryFn: () => customersService.bookingsFor(id!),
|
||||
enabled: Boolean(id),
|
||||
});
|
||||
}
|
||||
|
||||
export function useCustomerDocuments(id: string | undefined) {
|
||||
return useQuery({
|
||||
queryKey: QUERY_KEYS.CUSTOMERS.documents(id ?? ""),
|
||||
queryFn: () => customersService.documentsFor(id!),
|
||||
enabled: Boolean(id),
|
||||
});
|
||||
}
|
||||
|
||||
export function useCustomerPayments(id: string | undefined) {
|
||||
return useQuery({
|
||||
queryKey: QUERY_KEYS.CUSTOMERS.payments(id ?? ""),
|
||||
queryFn: () => customersService.paymentsFor(id!),
|
||||
enabled: Boolean(id),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user