mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
Code formatting with prettier, change eslint config for the server
This commit is contained in:
parent
bc87c1d883
commit
7a3805e64c
191 changed files with 4321 additions and 2880 deletions
|
@ -1,7 +1,7 @@
|
|||
const Errors = {
|
||||
TASK_NOT_FOUND: {
|
||||
notFound: 'Task is not found'
|
||||
}
|
||||
notFound: 'Task is not found',
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
@ -9,26 +9,29 @@ module.exports = {
|
|||
id: {
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
required: true
|
||||
}
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
exits: {
|
||||
notFound: {
|
||||
responseType: 'notFound'
|
||||
}
|
||||
responseType: 'notFound',
|
||||
},
|
||||
},
|
||||
|
||||
fn: async function(inputs, exits) {
|
||||
async fn(inputs, exits) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
let { task, board, project } = await sails.helpers
|
||||
const taskToProjectPath = await sails.helpers
|
||||
.getTaskToProjectPath(inputs.id)
|
||||
.intercept('notFound', () => Errors.TASK_NOT_FOUND);
|
||||
|
||||
let { task } = taskToProjectPath;
|
||||
const { board, project } = taskToProjectPath;
|
||||
|
||||
const isUserMemberForProject = await sails.helpers.isUserMemberForProject(
|
||||
project.id,
|
||||
currentUser.id
|
||||
currentUser.id,
|
||||
);
|
||||
|
||||
if (!isUserMemberForProject) {
|
||||
|
@ -42,7 +45,7 @@ module.exports = {
|
|||
}
|
||||
|
||||
return exits.success({
|
||||
item: task
|
||||
item: task,
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue