feat: duplicate a document as draft (#6782)

* feat: duplicate a document as draft

* review

* Default `publish` toggle to match current document

Ensures duplicating a draft does not publish it.

---------

Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
Hemachandar
2024-04-13 06:17:59 +05:30
committed by GitHub
parent 0b99a88cd7
commit 581944e754
5 changed files with 63 additions and 11 deletions

View File

@@ -509,8 +509,11 @@ export default class Document extends ParanoidModel {
move = (collectionId: string, parentDocumentId?: string | undefined) =>
this.store.move(this.id, collectionId, parentDocumentId);
duplicate = (options?: { title?: string; recursive?: boolean }) =>
this.store.duplicate(this, options);
duplicate = (options?: {
title?: string;
publish?: boolean;
recursive?: boolean;
}) => this.store.duplicate(this, options);
@computed
get pinned(): boolean {