1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-21 14:19:44 +02:00

Project managers, board members, auto-update after reconnection, refactoring

This commit is contained in:
Maksim Eltyshev 2021-06-24 01:05:22 +05:00
parent d6cb1f6683
commit b39119ace4
478 changed files with 21226 additions and 19495 deletions

View file

@ -19,21 +19,29 @@ module.exports = {
},
},
async fn(inputs, exits) {
async fn(inputs) {
const { currentUser } = this.req;
let project = await Project.findOne(inputs.id);
if (!project) {
throw Errors.PROJECT_NOT_FOUND;
}
project = await sails.helpers.deleteProject(project, this.req);
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
if (!isProjectManager) {
throw Errors.PROJECT_NOT_FOUND; // Forbidden
}
project = await sails.helpers.projects.deleteOne(project, this.req);
if (!project) {
throw Errors.PROJECT_NOT_FOUND;
}
return exits.success({
return {
item: project,
});
};
},
};