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:
David Montero Crespo 2026-07-16 04:27:32 +02:00
parent cb14af7b4f
commit 6eba0d4850
1 changed files with 8 additions and 0 deletions

View File

@ -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;
}