fix for bool

This commit is contained in:
estevez-dev 2020-05-25 19:10:31 +03:00
parent 4c02282549
commit 0be8c156ab

View File

@ -61,7 +61,7 @@ module.exports = {
payload.data.imageUrl = req.body.data.image;
}
for (const key of ['color', 'channelId', 'image', 'tag', 'dismiss', 'autoDismiss']) {
if (req.body.data[key] !== null) {
if (req.body.data[key] !== null && typeof req.body.data[key] !== 'undefined') {
payload.data[key] = String(req.body.data[key])
}
}