1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-20 13:49:43 +02:00

Prepare for collection board type, refactoring, update dependencies

This commit is contained in:
Maksim Eltyshev 2020-08-04 01:32:46 +05:00
parent 2d92ade8dc
commit c6ee7d54bb
190 changed files with 2144 additions and 1817 deletions

View file

@ -10,12 +10,29 @@ module.exports = {
},
values: {
type: 'json',
custom: (value) =>
_.isPlainObject(value) &&
(_.isUndefined(value.email) || _.isString(value.email)) &&
(_.isUndefined(value.password) || _.isString(value.password)) &&
(!value.username || _.isString(value.username)) &&
(_.isUndefined(value.avatarUrl) || _.isNull(value.avatarUrl)),
custom: (value) => {
if (!_.isPlainObject(value)) {
return false;
}
if (!_.isUndefined(value.email) && !_.isString(value.email)) {
return false;
}
if (!_.isUndefined(value.password) && !_.isString(value.password)) {
return false;
}
if (value.username && !_.isString(value.username)) {
return false;
}
if (!_.isUndefined(value.avatarUrl) && !_.isNull(value.avatarUrl)) {
return false;
}
return true;
},
required: true,
},
request: {
@ -88,11 +105,8 @@ module.exports = {
if (!isOnlyPasswordChange) {
const adminUserIds = await sails.helpers.getAdminUserIds();
const projectIds = await sails.helpers.getMembershipProjectIdsForUser(user.id);
const userIdsForProject = await sails.helpers.getMembershipUserIdsForProject(projectIds);
const userIds = _.union([user.id], adminUserIds, userIdsForProject);
userIds.forEach((userId) => {