chore: deactivate user option added (#2841)
* dev: deactivate user option added * chore: new layout for profile settings * fix: build errors * fix: user profile activity
This commit is contained in:
parent
3c89ef8cc3
commit
db75eced0a
53 changed files with 799 additions and 625 deletions
|
|
@ -61,28 +61,4 @@ export class ProjectMemberService extends APIService {
|
|||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async fetchProjectInvitations(workspaceSlug: string, projectId: string): Promise<IProjectMemberInvitation[]> {
|
||||
return this.get(`/api/workspaces/${workspaceSlug}/projects/${projectId}/invitations/`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async updateProjectInvitation(workspaceSlug: string, projectId: string, invitationId: string): Promise<any> {
|
||||
return this.put(`/api/workspaces/${workspaceSlug}/projects/${projectId}/invitations/${invitationId}/`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async deleteProjectInvitation(workspaceSlug: string, projectId: string, invitationId: string): Promise<any> {
|
||||
return this.delete(`/api/workspaces/${workspaceSlug}/projects/${projectId}/invitations/${invitationId}/`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,22 +68,6 @@ export class ProjectService extends APIService {
|
|||
});
|
||||
}
|
||||
|
||||
async joinProject(workspaceSlug: string, project_ids: string[]): Promise<any> {
|
||||
return this.post(`/api/users/me/workspaces/${workspaceSlug}/projects/invitations/`, { project_ids })
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async leaveProject(workspaceSlug: string, projectId: string): Promise<any> {
|
||||
return this.delete(`/api/workspaces/${workspaceSlug}/projects/${projectId}/members/leave/`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async setProjectView(
|
||||
workspaceSlug: string,
|
||||
projectId: string,
|
||||
|
|
|
|||
|
|
@ -96,8 +96,8 @@ export class UserService extends APIService {
|
|||
});
|
||||
}
|
||||
|
||||
async getUserWorkspaceActivity(workspaceSlug: string): Promise<IUserActivityResponse> {
|
||||
return this.get(`/api/users/workspaces/${workspaceSlug}/activities/`)
|
||||
async getUserActivity(): Promise<IUserActivityResponse> {
|
||||
return this.get(`/api/users/me/activities/`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
|
|
@ -185,12 +185,35 @@ export class UserService extends APIService {
|
|||
});
|
||||
}
|
||||
|
||||
async deleteAccount(): Promise<void> {
|
||||
return this.delete("/api/users/me/")
|
||||
async deactivateAccount() {
|
||||
return this.delete(`/api/users/me/`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response;
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async leaveWorkspace(workspaceSlug: string) {
|
||||
return this.post(`/api/workspaces/${workspaceSlug}/members/leave/`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async joinProject(workspaceSlug: string, project_ids: string[]): Promise<any> {
|
||||
return this.post(`/api/users/me/workspaces/${workspaceSlug}/projects/invitations/`, { project_ids })
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async leaveProject(workspaceSlug: string, projectId: string) {
|
||||
return this.post(`/api/workspaces/${workspaceSlug}/projects/${projectId}/members/leave/`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue