mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 02:16:34 +00:00
Fix: Format entire frontend properly
This commit is contained in:
@@ -1,4 +1 @@
|
||||
export {
|
||||
useCreateAPIKeyV2,
|
||||
useDeleteAPIKeyV2,
|
||||
useUpdateAPIKeyV2} from "./queries";
|
||||
export { useCreateAPIKeyV2, useDeleteAPIKeyV2, useUpdateAPIKeyV2 } from "./queries";
|
||||
|
||||
@@ -8,14 +8,13 @@ import {
|
||||
CreateAPIKeyDataV2DTO,
|
||||
CreateServiceTokenDataV3Res,
|
||||
DeleteAPIKeyDataV2DTO,
|
||||
UpdateAPIKeyDataV2DTO} from "./types";
|
||||
UpdateAPIKeyDataV2DTO
|
||||
} from "./types";
|
||||
|
||||
export const useCreateAPIKeyV2 = () => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation<CreateServiceTokenDataV3Res, {}, CreateAPIKeyDataV2DTO>({
|
||||
mutationFn: async ({
|
||||
name
|
||||
}) => {
|
||||
mutationFn: async ({ name }) => {
|
||||
const { data } = await apiRequest.post("/api/v3/api-key", {
|
||||
name
|
||||
});
|
||||
@@ -31,11 +30,10 @@ export const useCreateAPIKeyV2 = () => {
|
||||
export const useUpdateAPIKeyV2 = () => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation<APIKeyDataV2, {}, UpdateAPIKeyDataV2DTO>({
|
||||
mutationFn: async ({
|
||||
apiKeyDataId,
|
||||
name
|
||||
}) => {
|
||||
const { data: { apiKeyData } } = await apiRequest.patch(`/api/v3/api-key/${apiKeyDataId}`, {
|
||||
mutationFn: async ({ apiKeyDataId, name }) => {
|
||||
const {
|
||||
data: { apiKeyData }
|
||||
} = await apiRequest.patch(`/api/v3/api-key/${apiKeyDataId}`, {
|
||||
name
|
||||
});
|
||||
return apiKeyData;
|
||||
@@ -49,14 +47,14 @@ export const useUpdateAPIKeyV2 = () => {
|
||||
export const useDeleteAPIKeyV2 = () => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation<APIKeyDataV2, {}, DeleteAPIKeyDataV2DTO>({
|
||||
mutationFn: async ({
|
||||
apiKeyDataId
|
||||
}) => {
|
||||
const { data: { apiKeyData } } = await apiRequest.delete(`/api/v3/api-key/${apiKeyDataId}`);
|
||||
mutationFn: async ({ apiKeyDataId }) => {
|
||||
const {
|
||||
data: { apiKeyData }
|
||||
} = await apiRequest.delete(`/api/v3/api-key/${apiKeyDataId}`);
|
||||
return apiKeyData;
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries(userKeys.myAPIKeysV2);
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user