mirror of
https://github.com/strapi/strapi.git
synced 2025-07-21 07:57:45 +00:00
Merge branch 'feature/review-workflow-create-route' into feature/review-workflow-update-route
This commit is contained in:
commit
c20ac696c7
@ -373,6 +373,12 @@ describe('Role CRUD End to End', () => {
|
|||||||
"displayName": "Update",
|
"displayName": "Update",
|
||||||
"subCategory": "options",
|
"subCategory": "options",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"action": "admin::review-workflows.create",
|
||||||
|
"category": "review workflows",
|
||||||
|
"displayName": "Create",
|
||||||
|
"subCategory": "options",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"action": "admin::review-workflows.read",
|
"action": "admin::review-workflows.read",
|
||||||
"category": "review workflows",
|
"category": "review workflows",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { set } = require('lodash/fp');
|
const { set } = require('lodash/fp');
|
||||||
const { ApplicationError } = require('@strapi/utils').errors;
|
const { ValidationError } = require('@strapi/utils').errors;
|
||||||
const { WORKFLOW_MODEL_UID } = require('../../constants/workflows');
|
const { WORKFLOW_MODEL_UID } = require('../../constants/workflows');
|
||||||
const { getService } = require('../../utils');
|
const { getService } = require('../../utils');
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ module.exports = ({ strapi }) => ({
|
|||||||
|
|
||||||
async create(opts) {
|
async create(opts) {
|
||||||
if (!opts.data.stages) {
|
if (!opts.data.stages) {
|
||||||
throw new ApplicationError('Can not create a workflow without stages');
|
throw new ValidationError('Can not create a workflow without stages');
|
||||||
}
|
}
|
||||||
|
|
||||||
const stageIds = await getService('stages', { strapi })
|
const stageIds = await getService('stages', { strapi })
|
||||||
|
Loading…
x
Reference in New Issue
Block a user