mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 22:46:24 +00:00
misc: added ability for users to select KMS during project creation
This commit is contained in:
@@ -226,18 +226,20 @@ export const useGetWorkspaceIntegrations = (workspaceId: string) =>
|
||||
});
|
||||
|
||||
export const createWorkspace = ({
|
||||
projectName
|
||||
projectName,
|
||||
kmsKeyId
|
||||
}: CreateWorkspaceDTO): Promise<{ data: { project: Workspace } }> => {
|
||||
return apiRequest.post("/api/v2/workspace", { projectName });
|
||||
return apiRequest.post("/api/v2/workspace", { projectName, kmsKeyId });
|
||||
};
|
||||
|
||||
export const useCreateWorkspace = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation<{ data: { project: Workspace } }, {}, CreateWorkspaceDTO>({
|
||||
mutationFn: async ({ projectName }) =>
|
||||
mutationFn: async ({ projectName, kmsKeyId }) =>
|
||||
createWorkspace({
|
||||
projectName
|
||||
projectName,
|
||||
kmsKeyId
|
||||
}),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries(workspaceKeys.getAllUserWorkspace);
|
||||
|
||||
@@ -48,6 +48,7 @@ export type TGetUpgradeProjectStatusDTO = {
|
||||
// mutation dto
|
||||
export type CreateWorkspaceDTO = {
|
||||
projectName: string;
|
||||
kmsKeyId?: string;
|
||||
};
|
||||
|
||||
export type RenameWorkspaceDTO = { workspaceID: string; newWorkspaceName: string };
|
||||
|
||||
Reference in New Issue
Block a user