mirror of
https://github.com/plankanban/planka.git
synced 2025-07-24 15:49:46 +02:00
ref: Little refactoring
This commit is contained in:
parent
6021d67a00
commit
b58b91baa1
8 changed files with 14 additions and 17 deletions
|
@ -3,7 +3,7 @@ const valuesValidator = (value) => {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!_.isFinite(value.position)) {
|
||||
if (!_.isUndefined(value.position) && !_.isFinite(value.position)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ module.exports = {
|
|||
throw 'userMustBePresent';
|
||||
}
|
||||
|
||||
if (!_.isNil(values.position)) {
|
||||
if (!_.isUndefined(values.position)) {
|
||||
const boardId = values.boardId || inputs.record.boardId;
|
||||
const listId = values.listId || inputs.record.listId;
|
||||
|
||||
|
|
|
@ -6,11 +6,11 @@ const valuesValidator = (value) => {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (value.background && !_.isPlainObject(value.background)) {
|
||||
if (!_.isNil(value.background) && !_.isPlainObject(value.background)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (value.backgroundImage && !_.isPlainObject(value.backgroundImage)) {
|
||||
if (!_.isNil(value.backgroundImage) && !_.isPlainObject(value.backgroundImage)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ const valuesValidator = (value) => {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (value.username && !_.isString(value.username)) {
|
||||
if (!_.isNil(value.username) && !_.isString(value.username)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,11 +16,11 @@ const valuesValidator = (value) => {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (value.username && !_.isString(value.username)) {
|
||||
if (!_.isNil(value.username) && !_.isString(value.username)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (value.avatar && !_.isPlainObject(value.avatar)) {
|
||||
if (!_.isNil(value.avatar) && !_.isPlainObject(value.avatar)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue