csv setupdata
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
'use client';
|
||||
|
||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
|
||||
import { completeBootstrapSetup, completeSetupRun, saveSetupStep, startSetupRun } from './service';
|
||||
import { setupKeys } from './queries';
|
||||
import type { SaveSetupStepPayload } from './types';
|
||||
import type { CompleteBootstrapSetupPayload, SaveSetupStepPayload } from './types';
|
||||
|
||||
function useInvalidateSetupRun() {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return () => {
|
||||
queryClient.invalidateQueries({ queryKey: setupKeys.run() });
|
||||
queryClient.invalidateQueries({ queryKey: [...setupKeys.all, 'bootstrap'] });
|
||||
queryClient.invalidateQueries({ queryKey: setupKeys.report() });
|
||||
queryClient.invalidateQueries({ queryKey: setupKeys.bootstrapStatus() });
|
||||
};
|
||||
}
|
||||
|
||||
@@ -45,7 +48,7 @@ export function useCompleteBootstrapSetup() {
|
||||
const invalidate = useInvalidateSetupRun();
|
||||
|
||||
return useMutation({
|
||||
mutationFn: (report: Record<string, unknown>) => completeBootstrapSetup(report),
|
||||
mutationFn: (input: CompleteBootstrapSetupPayload) => completeBootstrapSetup(input),
|
||||
onSuccess: invalidate
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user