Duplicate records as drafts, and preview them from the form

The copy keeps the content, stack and team, but is unpublished, out of any
review, and gets a title marked as a copy and a free slug. It replaces
Filament's replicate action, which left the copy without a slug and still
published. The same copy is available through the API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 10:14:51 +02:00
parent 70521d4bc9
commit 366568b793
18 changed files with 486 additions and 64 deletions

View File

@@ -4023,6 +4023,126 @@ paths:
schema: { $ref: "#/components/schemas/AuditLogCollection" }
"403": { $ref: "#/components/responses/Forbidden" }
/v1/pages/{page}/duplicate:
post:
tags: [Reviews]
summary: Duplicate a page as a draft
description: |
A copy to start the next one from: the same content and relations,
unpublished, out of any review, its title marked as a copy and a free
slug in each language.
parameters:
- name: page
in: path
required: true
schema: { type: integer }
responses:
"201":
description: The copy
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
type: { type: string }
id: { type: integer }
title: { type: string }
slug: { type: object, additionalProperties: { type: string } }
"403": { $ref: "#/components/responses/Forbidden" }
/v1/projects/{project}/duplicate:
post:
tags: [Reviews]
summary: Duplicate a project as a draft
description: |
A copy to start the next one from: the same content and relations,
unpublished, out of any review, its title marked as a copy and a free
slug in each language.
parameters:
- name: project
in: path
required: true
schema: { type: integer }
responses:
"201":
description: The copy
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
type: { type: string }
id: { type: integer }
title: { type: string }
slug: { type: object, additionalProperties: { type: string } }
"403": { $ref: "#/components/responses/Forbidden" }
/v1/services/{service}/duplicate:
post:
tags: [Reviews]
summary: Duplicate a service as a draft
description: |
A copy to start the next one from: the same content and relations,
unpublished, out of any review, its title marked as a copy and a free
slug in each language.
parameters:
- name: service
in: path
required: true
schema: { type: integer }
responses:
"201":
description: The copy
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
type: { type: string }
id: { type: integer }
title: { type: string }
slug: { type: object, additionalProperties: { type: string } }
"403": { $ref: "#/components/responses/Forbidden" }
/v1/calls/{call}/duplicate:
post:
tags: [Reviews]
summary: Duplicate a call as a draft
description: |
A copy to start the next one from: the same content and relations,
unpublished, out of any review, its title marked as a copy and a free
slug in each language.
parameters:
- name: call
in: path
required: true
schema: { type: integer }
responses:
"201":
description: The copy
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
type: { type: string }
id: { type: integer }
title: { type: string }
slug: { type: object, additionalProperties: { type: string } }
"403": { $ref: "#/components/responses/Forbidden" }
/v1/media:
get:
tags: [Media]