2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-03 13:58:47 +00:00

Fix for hasOwn (#8600)

- Also add null check on function call
- Closes https://github.com/inventree/InvenTree/issues/8595
This commit is contained in:
Oliver 2024-11-30 21:32:48 +11:00 committed by GitHub
parent 3149ae79ce
commit 7a3ceb9d6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,7 +37,10 @@ function post(path: string, params: any, method = 'post') {
form.action = path;
for (const key in params) {
if (params.hasOwn(key)) {
if (
params.hasOwn?.(key) ||
Object.prototype.hasOwnProperty.call(params, key)
) {
const hiddenField = document.createElement('input');
hiddenField.type = 'hidden';
hiddenField.name = key;