mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
🔒 fix warning from deepcode
This commit is contained in:
parent
24035329b8
commit
9cbef4ba4b
1 changed files with 7 additions and 5 deletions
|
@ -453,16 +453,18 @@ if (Meteor.isServer) {
|
|||
(req, res) => {
|
||||
Authentication.checkUserId(req.userId);
|
||||
|
||||
if (req.body.hasOwnProperty('items')) {
|
||||
if (req.body.hasOwnProperty('items') && Array.isArray(req.body.items)) {
|
||||
CustomFields.direct.update(
|
||||
{ _id: req.params.customFieldId },
|
||||
{
|
||||
$push: {
|
||||
'settings.dropdownItems': {
|
||||
$each: req.body.items.map(name => ({
|
||||
_id: Random.id(6),
|
||||
name,
|
||||
})),
|
||||
$each: req.body.items
|
||||
.filter(name => typeof name === 'string')
|
||||
.map(name => ({
|
||||
_id: Random.id(6),
|
||||
name,
|
||||
})),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue