Skip to content

Commit b647455

Browse files
committed
feat: add project management API functions
- Introduced new API functions for project management, including getProjectDetails, deleteProject, and updateProject. - Enhanced the project API with additional capabilities for retrieving, deleting, and updating project data.
1 parent 97a26ca commit b647455

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

lib/api/project.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,24 @@ export const getProjects = async (): Promise<{
1616
return res.data.data;
1717
};
1818

19+
export const getProjectDetails = async (_projectId: string) => {
20+
const res = await api.get(`/projects/${_projectId}`);
21+
return res.data.data;
22+
};
23+
24+
export const deleteProject = async (_projectId: string) => {
25+
const res = await api.delete(`/projects/${_projectId}`);
26+
return res.data.data;
27+
};
28+
29+
export const updateProject = async (
30+
_projectId: string,
31+
data: ProjectInitRequest
32+
) => {
33+
const res = await api.put(`/projects/${_projectId}`, data);
34+
return res.data.data;
35+
};
36+
1937
export const getCampaignDetails = async (_projectId: string) => {
2038
// Mock implementation for now
2139
return new Promise(resolve => {

0 commit comments

Comments
 (0)