From 6eba0d4850b51b0d24cdf5ef1f4e0945de50fdb1 Mon Sep 17 00:00:00 2001 From: David Montero Crespo Date: Thu, 16 Jul 2026 04:27:32 +0200 Subject: [PATCH] feat(projects): duplicateProject client for POST /projects/{id}/duplicate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- frontend/src/services/projectService.ts | 8 ++++++++ 1 file changed, 8 insertions(+) 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; +}