diff --git a/frontend/src/services/projectService.ts b/frontend/src/services/projectService.ts index f2fd33a8..a15f0cb2 100644 --- a/frontend/src/services/projectService.ts +++ b/frontend/src/services/projectService.ts @@ -102,3 +102,11 @@ export async function updateProject( export async function deleteProject(id: string): Promise { 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 { + const { data: result } = await api.post(`/projects/${id}/duplicate`); + return result; +}