Fixed tasks buttons by replacing the error with a warning when setting properties to undefined. (#618)

This commit is contained in:
Marc-Andre Ferland 2022-12-06 11:19:05 -05:00 committed by GitHub
parent ef90832aea
commit 7984327d81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -806,6 +806,11 @@
continue
}
if (key in TASK_OPTIONAL) {
if (typeof this._reqBody[key] == "undefined") {
delete this._reqBody[key]
console.warn(`reqBody[${key}] was set to undefined. Removing optional key without value...`)
continue
}
if (typeof this._reqBody[key] !== TASK_OPTIONAL[key]) {
throw new Error(`${key} need to be of type ${TASK_OPTIONAL[key]} but ${typeof this._reqBody[key]} was found.`)
}