diff --git a/frontend/src/services/projectService.ts b/frontend/src/services/projectService.ts index a15f0cb2..767c9d0f 100644 --- a/frontend/src/services/projectService.ts +++ b/frontend/src/services/projectService.ts @@ -103,10 +103,26 @@ export async function deleteProject(id: string): Promise { await api.delete(`/projects/${id}`); } +/** Optional overrides for a duplicate — the Duplicate dialog supplies name / + * description / visibility; omit any field to inherit the source. */ +export interface DuplicateOptions { + name?: string; + description?: string; + is_public?: boolean; + visibility?: ProjectVisibility; +} + /** 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`); + * anyone. With no options the copy takes the source name + " (copy)" and + * its visibility. Returns the freshly created copy. */ +export async function duplicateProject( + id: string, + options?: DuplicateOptions, +): Promise { + const { data: result } = await api.post( + `/projects/${id}/duplicate`, + options ?? {}, + ); return result; }