You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
planka_custom/server/api/controllers/projects/create.js

28 lines
462 B
JavaScript

module.exports = {
inputs: {
name: {
type: 'string',
required: true,
},
},
async fn(inputs) {
const { currentUser } = this.req;
const values = _.pick(inputs, ['name']);
const { project, projectManager } = await sails.helpers.projects.createOne(
values,
currentUser,
this.req,
);
return {
item: project,
included: {
projectManagers: [projectManager],
},
};
},
};