Logo
Explore Help
Register Sign In
yujunjun/strapi
1
0
Fork 0
You've already forked strapi
mirror of https://github.com/strapi/strapi.git synced 2025-07-30 04:20:34 +00:00
Code Issues Packages Projects Releases Wiki Activity
strapi/packages/core/content-manager/server/policies/has-draft-and-publish.js

14 lines
264 B
JavaScript
Raw Normal View History

[D&P] Publish a draft (#7532) * Add publish a draft capability. Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-08-21 16:19:11 +02:00
'use strict';
const {
contentTypes: { hasDraftAndPublish },
Rename import & requires, fix tests
2021-04-29 13:51:12 +02:00
} = require('@strapi/utils');
[D&P] Publish a draft (#7532) * Add publish a draft capability. Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-08-21 16:19:11 +02:00
Harmonize and make policies and middlwares more consistent
2021-10-04 18:16:28 +02:00
module.exports = (ctx, { strapi }) => {
const { model: modelUID } = ctx.params;
[D&P] Publish a draft (#7532) * Add publish a draft capability. Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-08-21 16:19:11 +02:00
Harmonize and make policies and middlwares more consistent
2021-10-04 18:16:28 +02:00
const model = strapi.contentTypes[modelUID];
[D&P] Publish a draft (#7532) * Add publish a draft capability. Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-08-21 16:19:11 +02:00
refactor error handling
2021-10-20 17:30:05 +02:00
return hasDraftAndPublish(model);
[D&P] Publish a draft (#7532) * Add publish a draft capability. Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-08-21 16:19:11 +02:00
};
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.5 Page: 783ms Template: 8ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API