Can the entry generated by the Duplicate operation be specified as draft state? #1268
Answered
by
DanRibbens
blueMountain007
asked this question in
Q&A
-
Can the entry generated by the Duplicate operation be specified as draft state? |
Beta Was this translation helpful? Give feedback.
Answered by
DanRibbens
Feb 3, 2023
Replies: 1 comment
-
Hi @zhounewz, this is now possible using the Here is an example of how this would look in your case: const Posts: CollectionConfig = {
slug: 'posts',
admin: {
hooks: {
beforeDuplicate: ({ data }) => {
return {
...data,
_status: 'draft',
};
},
},
},
versions: {
drafts: true,
},
fields: [
// ...
],
}; Cheers! |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
zubricks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @zhounewz, this is now possible using the
beforeDuplicate
admin hook.Here is an example of how this would look in your case:
Cheers!