mirror of
https://github.com/plankanban/planka.git
synced 2025-07-21 22:29:42 +02:00
ref: Remove board types, refactoring
This commit is contained in:
parent
2b131f76c1
commit
6ffa817b53
182 changed files with 1573 additions and 1239 deletions
|
@ -12,6 +12,8 @@ const Errors = {
|
|||
},
|
||||
};
|
||||
|
||||
const passwordValidator = (value) => zxcvbn(value).score >= 2; // TODO: move to config
|
||||
|
||||
module.exports = {
|
||||
inputs: {
|
||||
id: {
|
||||
|
@ -21,7 +23,7 @@ module.exports = {
|
|||
},
|
||||
password: {
|
||||
type: 'string',
|
||||
custom: (value) => zxcvbn(value).score >= 2, // TODO: move to config
|
||||
custom: passwordValidator,
|
||||
required: true,
|
||||
},
|
||||
currentPassword: {
|
||||
|
@ -64,7 +66,13 @@ module.exports = {
|
|||
}
|
||||
|
||||
const values = _.pick(inputs, ['password']);
|
||||
user = await sails.helpers.users.updateOne(user, values, currentUser, this.req);
|
||||
|
||||
user = await sails.helpers.users.updateOne.with({
|
||||
values,
|
||||
record: user,
|
||||
user: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
if (!user) {
|
||||
throw Errors.USER_NOT_FOUND;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue