260324:1349 Refactor RFA #01
CI / CD Pipeline / build (push) Failing after 1m52s
CI / CD Pipeline / deploy (push) Has been skipped

This commit is contained in:
admin
2026-03-24 13:49:30 +07:00
parent a3e3206b06
commit 4cd0952482
29 changed files with 1700 additions and 306 deletions
+19
View File
@@ -34,6 +34,25 @@ export function useRFA(uuid: string) {
// --- Mutations ---
export function useSubmitRFA() {
const queryClient = useQueryClient();
return useMutation({
mutationFn: ({ uuid, templateId }: { uuid: string; templateId: number }) =>
rfaService.submit(uuid, templateId),
onSuccess: (_, { uuid }) => {
toast.success('RFA submitted successfully');
queryClient.invalidateQueries({ queryKey: rfaKeys.detail(uuid) });
queryClient.invalidateQueries({ queryKey: rfaKeys.lists() });
},
onError: (error: unknown) => {
toast.error('Failed to submit RFA', {
description: getApiErrorMessage(error, 'Something went wrong'),
});
},
});
}
export function useCreateRFA() {
const queryClient = useQueryClient();