260316:1524 Refactor to UUID
Build and Deploy / deploy (push) Successful in 3m25s

This commit is contained in:
admin
2026-03-16 15:24:26 +07:00
parent 3636b3c831
commit 4f7d9bb80c
3 changed files with 17 additions and 16 deletions
+5 -5
View File
@@ -15,7 +15,7 @@ export const masterDataKeys = {
all: ['masterData'] as const,
organizations: () => [...masterDataKeys.all, 'organizations'] as const,
correspondenceTypes: () => [...masterDataKeys.all, 'correspondenceTypes'] as const,
disciplines: (contractId?: number) => [...masterDataKeys.all, 'disciplines', contractId] as const,
disciplines: (contractId?: number | string) => [...masterDataKeys.all, 'disciplines', contractId] as const,
};
export function useOrganizations(params?: SearchOrganizationDto) {
@@ -74,7 +74,7 @@ export function useDeleteOrganization() {
});
}
export function useDisciplines(contractId?: number) {
export function useDisciplines(contractId?: number | string) {
return useQuery({
queryKey: masterDataKeys.disciplines(contractId),
queryFn: () => masterDataService.getDisciplines(contractId),
@@ -88,10 +88,10 @@ export function useProjects(isActive: boolean = true) {
});
}
export function useContracts(projectId: number = 1) {
export function useContracts(projectId?: number | string) {
return useQuery({
queryKey: ['contracts', projectId],
queryFn: () => contractService.getAll({ projectId }),
queryKey: ['contracts', projectId ?? 'all'],
queryFn: () => contractService.getAll(projectId ? { projectId } : undefined),
});
}