mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
Project managers, board members, auto-update after reconnection, refactoring
This commit is contained in:
parent
7956503a46
commit
fe91b5241e
478 changed files with 21226 additions and 19495 deletions
|
@ -42,7 +42,7 @@ module.exports = {
|
|||
},
|
||||
},
|
||||
|
||||
async fn(inputs, exits) {
|
||||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
if (inputs.id === currentUser.id) {
|
||||
|
@ -53,7 +53,7 @@ module.exports = {
|
|||
throw Errors.USER_NOT_FOUND; // Forbidden
|
||||
}
|
||||
|
||||
let user = await sails.helpers.getUser(inputs.id);
|
||||
let user = await sails.helpers.users.getOne(inputs.id);
|
||||
|
||||
if (!user) {
|
||||
throw Errors.USER_NOT_FOUND;
|
||||
|
@ -68,16 +68,16 @@ module.exports = {
|
|||
|
||||
const values = _.pick(inputs, ['email']);
|
||||
|
||||
user = await sails.helpers
|
||||
.updateUser(user, values, this.req)
|
||||
user = await sails.helpers.users
|
||||
.update(user, values, this.req)
|
||||
.intercept('emailAlreadyInUse', () => Errors.EMAIL_ALREADY_IN_USE);
|
||||
|
||||
if (!user) {
|
||||
throw Errors.USER_NOT_FOUND;
|
||||
}
|
||||
|
||||
return exits.success({
|
||||
return {
|
||||
item: user,
|
||||
});
|
||||
};
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue