feat: comfirm workspace deletion by typing, showing toast alert, users can't edit email from profile page
feat: all added services for fetching last active workspace details
This commit is contained in:
parent
74a27edb09
commit
aa21c97ed2
7 changed files with 128 additions and 48 deletions
|
|
@ -11,6 +11,7 @@ import {
|
|||
WORKSPACE_INVITATION_DETAIL,
|
||||
USER_WORKSPACE_INVITATION,
|
||||
USER_WORKSPACE_INVITATIONS,
|
||||
LAST_ACTIVE_WORKSPACE_AND_PROJECTS,
|
||||
} from "constants/api-routes";
|
||||
// services
|
||||
import APIService from "lib/services/api.service";
|
||||
|
|
@ -18,7 +19,12 @@ import APIService from "lib/services/api.service";
|
|||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
|
||||
// types
|
||||
import { IWorkspace, IWorkspaceMember, IWorkspaceMemberInvitation } from "types";
|
||||
import {
|
||||
ILastActiveWorkspaceDetails,
|
||||
IWorkspace,
|
||||
IWorkspaceMember,
|
||||
IWorkspaceMemberInvitation,
|
||||
} from "types";
|
||||
|
||||
class WorkspaceService extends APIService {
|
||||
constructor() {
|
||||
|
|
@ -97,6 +103,16 @@ class WorkspaceService extends APIService {
|
|||
});
|
||||
}
|
||||
|
||||
async getLastActiveWorkspaceAndProjects(): Promise<ILastActiveWorkspaceDetails> {
|
||||
return this.get(LAST_ACTIVE_WORKSPACE_AND_PROJECTS)
|
||||
.then((response) => {
|
||||
return response?.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async userWorkspaceInvitations(): Promise<IWorkspaceMemberInvitation[]> {
|
||||
return this.get(USER_WORKSPACE_INVITATIONS)
|
||||
.then((response) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue