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.
28 lines
484 B
JavaScript
28 lines
484 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.with({
|
|
values,
|
|
user: currentUser,
|
|
request: this.req,
|
|
});
|
|
|
|
return {
|
|
item: project,
|
|
included: {
|
|
projectManagers: [projectManager],
|
|
},
|
|
};
|
|
},
|
|
};
|