mirror of
https://github.com/strapi/strapi.git
synced 2025-06-27 00:41:25 +00:00
fix: draftAndPublish default to false
This commit is contained in:
parent
fc9cfcfff7
commit
45c1c52b0b
@ -109,9 +109,9 @@ const isVisibleAttribute = (model: Model, attributeName: string) => {
|
||||
};
|
||||
|
||||
const getOptions = (model: Model) =>
|
||||
_.assign({ draftAndPublish: true }, _.get(model, 'options', {}));
|
||||
_.assign({ draftAndPublish: false }, _.get(model, 'options', {}));
|
||||
|
||||
const hasDraftAndPublish = (model: Model) => _.get(model, 'options.draftAndPublish', true) === true;
|
||||
const hasDraftAndPublish = (model: Model) => _.get(model, 'options.draftAndPublish', false) === true;
|
||||
|
||||
const isDraft = <T extends object>(data: T, model: Model) =>
|
||||
hasDraftAndPublish(model) && _.get(data, PUBLISHED_AT_ATTRIBUTE) === null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user