251208:1625 Frontend: to be complete admin panel, Backend: tobe recheck all task
Some checks failed
Spec Validation / validate-markdown (push) Has been cancelled
Spec Validation / validate-diagrams (push) Has been cancelled
Spec Validation / check-todos (push) Has been cancelled

This commit is contained in:
admin
2025-12-08 16:25:56 +07:00
parent dcd126d704
commit 863a727756
64 changed files with 5956 additions and 1256 deletions

View File

@@ -70,4 +70,23 @@ export function useSubmitCorrespondence() {
});
}
export function useProcessWorkflow() {
const queryClient = useQueryClient();
return useMutation({
mutationFn: ({ id, data }: { id: number | string; data: any }) =>
correspondenceService.processWorkflow(id, data),
onSuccess: (_, { id }) => {
toast.success('Action completed successfully');
queryClient.invalidateQueries({ queryKey: correspondenceKeys.detail(id) });
queryClient.invalidateQueries({ queryKey: correspondenceKeys.lists() });
},
onError: (error: any) => {
toast.error('Failed to process action', {
description: error.response?.data?.message || 'Something went wrong',
});
},
});
}
// Add more mutations as needed (update, delete, etc.)

View File

@@ -22,4 +22,12 @@ export function useDisciplines(contractId?: number) {
});
}
// Add other master data hooks as needed
// Add useContracts hook
import { projectService } from '@/lib/services/project.service';
export function useContracts(projectId: number = 1) {
return useQuery({
queryKey: ['contracts', projectId],
queryFn: () => projectService.getContracts(projectId),
});
}