From 7a3ceb9d6e110607b802c996dee3162eb6225012 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 30 Nov 2024 21:32:48 +1100 Subject: [PATCH] Fix for hasOwn (#8600) - Also add null check on function call - Closes https://github.com/inventree/InvenTree/issues/8595 --- src/frontend/src/functions/auth.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/functions/auth.tsx b/src/frontend/src/functions/auth.tsx index 98514c234a85..5e4aa69b7190 100644 --- a/src/frontend/src/functions/auth.tsx +++ b/src/frontend/src/functions/auth.tsx @@ -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;