mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 22:46:24 +00:00
Wired most of the frontend to support ghost users
This commit is contained in:
@@ -158,21 +158,19 @@ export const useGetWorkspaceIntegrations = (workspaceId: string) =>
|
||||
|
||||
export const createWorkspace = ({
|
||||
organizationId,
|
||||
projectName,
|
||||
inviteAllOrgMembers
|
||||
}: CreateWorkspaceDTO): Promise<{ data: { workspace: Workspace } }> => {
|
||||
return apiRequest.post("/api/v3/projects", { projectName, inviteAllOrgMembers, organizationId });
|
||||
projectName
|
||||
}: CreateWorkspaceDTO): Promise<{ data: { project: Workspace } }> => {
|
||||
return apiRequest.post("/api/v3/projects", { projectName, organizationId });
|
||||
};
|
||||
|
||||
export const useCreateWorkspace = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation<{ data: { workspace: Workspace } }, {}, CreateWorkspaceDTO>({
|
||||
mutationFn: async ({ organizationId, projectName, inviteAllOrgMembers }) =>
|
||||
return useMutation<{ data: { project: Workspace } }, {}, CreateWorkspaceDTO>({
|
||||
mutationFn: async ({ organizationId, projectName }) =>
|
||||
createWorkspace({
|
||||
organizationId,
|
||||
projectName,
|
||||
inviteAllOrgMembers
|
||||
projectName
|
||||
}),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries(workspaceKeys.getAllUserWorkspace);
|
||||
@@ -287,11 +285,13 @@ export const useAddUserToWorkspace = () => {
|
||||
return useMutation({
|
||||
mutationFn: async ({ email, workspaceId }: { email: string; workspaceId: string }) => {
|
||||
const {
|
||||
data: { invitee, latestKey }
|
||||
} = await apiRequest.post(`/api/v1/workspace/${workspaceId}/invite-signup`, { email });
|
||||
data: { invitees, latestKey }
|
||||
} = await apiRequest.post(`/api/v1/workspace/${workspaceId}/invite-signup`, {
|
||||
emails: [email]
|
||||
});
|
||||
|
||||
return {
|
||||
invitee,
|
||||
invitees,
|
||||
latestKey
|
||||
};
|
||||
},
|
||||
|
||||
@@ -3,6 +3,7 @@ export type Workspace = {
|
||||
id: string;
|
||||
name: string;
|
||||
orgId: string;
|
||||
e2ee: boolean;
|
||||
autoCapitalization: boolean;
|
||||
environments: WorkspaceEnv[];
|
||||
};
|
||||
@@ -26,7 +27,6 @@ export type NameWorkspaceSecretsDTO = {
|
||||
// mutation dto
|
||||
export type CreateWorkspaceDTO = {
|
||||
projectName: string;
|
||||
inviteAllOrgMembers: boolean;
|
||||
organizationId: string;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user