1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 13:19:44 +02:00
planka/server/api/controllers/projects/create.js

27 lines
462 B
JavaScript
Executable file

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],
},
};
},
};