feat(projects): duplicateProject client for POST /projects/{id}/duplicate
Pairs with the pro-overlay endpoint that clones a project (row + file groups) into the caller's account. Lives next to deleteProject — the OSS client already fronts the pro-only projects API when overlaid.
This commit is contained in:
parent
cb14af7b4f
commit
6eba0d4850
|
|
@ -102,3 +102,11 @@ export async function updateProject(
|
|||
export async function deleteProject(id: string): Promise<void> {
|
||||
await api.delete(`/projects/${id}`);
|
||||
}
|
||||
|
||||
/** Clone a project (row + files) into the caller's account. Owners can
|
||||
* duplicate any of their projects; public projects can be duplicated by
|
||||
* anyone. Returns the freshly created copy. */
|
||||
export async function duplicateProject(id: string): Promise<ProjectResponse> {
|
||||
const { data: result } = await api.post<ProjectResponse>(`/projects/${id}/duplicate`);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue