fix: mutation of project detail, removed two identifier validation and added default value for deep checking

This commit is contained in:
Dakshesh Jain 2022-12-08 20:29:12 +05:30
parent 1368fb9164
commit a1598e7310
19 changed files with 170 additions and 78 deletions

View file

@ -10,9 +10,12 @@ import {
PROJECT_MEMBERS,
PROJECT_MEMBER_DETAIL,
USER_PROJECT_INVITATIONS,
PROJECT_VIEW_ENDPOINT,
} from "constants/api-routes";
// services
import APIService from "lib/services/api.service";
// types
import type { ProjectViewTheme } from "types";
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
@ -177,6 +180,7 @@ class ProjectServices extends APIService {
throw error?.response?.data;
});
}
async deleteProjectInvitation(
workspace_slug: string,
project_id: string,
@ -190,6 +194,20 @@ class ProjectServices extends APIService {
throw error?.response?.data;
});
}
async setProjectView(
workspace_slug: string,
project_id: string,
data: ProjectViewTheme
): Promise<any> {
await this.patch(PROJECT_VIEW_ENDPOINT(workspace_slug, project_id), data)
.then((response) => {
return response?.data;
})
.catch((error) => {
throw error?.response?.data;
});
}
}
export default new ProjectServices();