mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 19:16:22 +00:00
feat: added resync replication feature
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
export { useCreateSecretImport, useDeleteSecretImport, useUpdateSecretImport } from "./mutation";
|
||||
export {
|
||||
useCreateSecretImport,
|
||||
useDeleteSecretImport,
|
||||
useResyncSecretReplication,
|
||||
useUpdateSecretImport
|
||||
} from "./mutation";
|
||||
export {
|
||||
useGetImportedFoldersByEnv,
|
||||
useGetImportedSecretsAllEnvs,
|
||||
|
||||
@@ -3,7 +3,12 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { apiRequest } from "@app/config/request";
|
||||
|
||||
import { secretImportKeys } from "./queries";
|
||||
import { TCreateSecretImportDTO, TDeleteSecretImportDTO, TUpdateSecretImportDTO } from "./types";
|
||||
import {
|
||||
TCreateSecretImportDTO,
|
||||
TDeleteSecretImportDTO,
|
||||
TResyncSecretReplicationDTO,
|
||||
TUpdateSecretImportDTO
|
||||
} from "./types";
|
||||
|
||||
export const useCreateSecretImport = () => {
|
||||
const queryClient = useQueryClient();
|
||||
@@ -54,6 +59,19 @@ export const useUpdateSecretImport = () => {
|
||||
});
|
||||
};
|
||||
|
||||
export const useResyncSecretReplication = () => {
|
||||
return useMutation<{}, {}, TResyncSecretReplicationDTO>({
|
||||
mutationFn: async ({ environment, projectId, path, id }) => {
|
||||
const { data } = await apiRequest.post(`/api/v1/secret-imports/${id}/replication-resync`, {
|
||||
environment,
|
||||
path,
|
||||
workspaceId: projectId
|
||||
});
|
||||
return data;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const useDeleteSecretImport = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
|
||||
@@ -76,6 +76,13 @@ export type TUpdateSecretImportDTO = {
|
||||
}>;
|
||||
};
|
||||
|
||||
export type TResyncSecretReplicationDTO = {
|
||||
id: string;
|
||||
projectId: string;
|
||||
environment: string;
|
||||
path?: string;
|
||||
};
|
||||
|
||||
export type TDeleteSecretImportDTO = {
|
||||
id: string;
|
||||
projectId: string;
|
||||
|
||||
Reference in New Issue
Block a user