Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat(frontend): update import mutation to return status and imported count

Igor Corread21b8357c88f
diff --git a/frontend/src/hooks/api/migration/mutations.tsx b/frontend/src/hooks/api/migration/mutations.tsx
index 0bdba3471b..0fd14bfde5 100644
--- a/frontend/src/hooks/api/migration/mutations.tsx
+++ b/frontend/src/hooks/api/migration/mutations.tsx
@@ -233,9 +233,13 @@ export const useDeleteDopplerExternalMigrationConfig = () => {
export const useImportDopplerSecrets = () => {
const queryClient = useQueryClient();
- return useMutation<void, Error, TImportDopplerSecretsDTO>({
+ return useMutation<{ status: string; imported: number }, Error, TImportDopplerSecretsDTO>({
mutationFn: async (dto) => {
- await apiRequest.post("/api/v3/external-migration/doppler/import-secrets", dto);
+ const { data } = await apiRequest.post<{ status: string; imported: number }>(
+ "/api/v3/external-migration/doppler/import-secrets",
+ dto
+ );
+ return data;
},
onSuccess: (_, { targetProjectId, targetEnvironment, targetSecretPath }) => {
queryClient.invalidateQueries({ queryKey: dashboardKeys.all() });