checkpoint

This commit is contained in:
=
2024-07-30 23:19:07 +05:30
parent 49eb6d6474
commit ab88e6c414
16 changed files with 315 additions and 126 deletions
+2 -1
View File
@@ -2,7 +2,8 @@ export {
useAddGroupToWorkspace,
useDeleteGroupFromWorkspace,
useLeaveProject,
useUpdateGroupWorkspaceRole
useUpdateGroupWorkspaceRole,
useMigrateProjectToV3
} from "./mutations";
export {
useAddIdentityToWorkspace,
@@ -74,3 +74,15 @@ export const useLeaveProject = () => {
}
});
};
export const useMigrateProjectToV3 = () => {
const queryClient = useQueryClient();
return useMutation<{}, {}, { workspaceId: string }>({
mutationFn: ({ workspaceId }) => {
return apiRequest.delete(`/api/v1/workspace/${workspaceId}/migrate-v3`);
},
onSuccess: () => {
queryClient.invalidateQueries(workspaceKeys.getAllUserWorkspace);
}
});
};
+6 -2
View File
@@ -150,11 +150,15 @@ export const useGetWorkspaceSecrets = (workspaceId: string) => {
});
};
export const useGetWorkspaceById = (workspaceId: string) => {
export const useGetWorkspaceById = (
workspaceId: string,
dto?: { refetchInterval?: number | false }
) => {
return useQuery({
queryKey: workspaceKeys.getWorkspaceById(workspaceId),
queryFn: () => fetchWorkspaceById(workspaceId),
enabled: Boolean(workspaceId)
enabled: Boolean(workspaceId),
refetchInterval: dto?.refetchInterval
});
};
+2 -1
View File
@@ -1,6 +1,7 @@
export enum ProjectVersion {
V1 = 1,
V2 = 2
V2 = 2,
V3 = 3
}
export enum ProjectUserMembershipTemporaryMode {