mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 13:56:43 +00:00
20 lines
640 B
TypeScript
20 lines
640 B
TypeScript
import { useMutation } from "@tanstack/react-query";
|
|
|
|
import { apiRequest } from "@app/config/request";
|
|
|
|
import { IntegrationAuth, TDuplicateIntegrationAuthDTO } from "./types";
|
|
|
|
// For now, this should only be used in the Github app integration flow.
|
|
export const useDuplicateIntegrationAuth = () => {
|
|
return useMutation<IntegrationAuth, {}, TDuplicateIntegrationAuthDTO>({
|
|
mutationFn: async (body) => {
|
|
const { data } = await apiRequest.post<{ integrationAuth: IntegrationAuth }>(
|
|
`/api/v1/integration-auth/${body.integrationAuthId}/duplicate`,
|
|
body
|
|
);
|
|
|
|
return data.integrationAuth;
|
|
}
|
|
});
|
|
};
|