From 91f85e33ebedba71bff705cd5c4e9431a620b815 Mon Sep 17 00:00:00 2001 From: LD-Reborn Date: Sat, 1 Nov 2025 17:18:35 +0100 Subject: [PATCH] Fixed numeric values in user create and update interpreted as int --- src/Views/Home/Users.cshtml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Views/Home/Users.cshtml b/src/Views/Home/Users.cshtml index 16cf2b1..a163eb6 100644 --- a/src/Views/Home/Users.cshtml +++ b/src/Views/Home/Users.cshtml @@ -243,23 +243,22 @@ let current = result; for (let i = 0; i < parts.length; i++) { const part = parts[i]; - if (i === parts.length - 1) { - // Last part — assign value - try { - // Try to parse JSON strings like "[...]" if possible - current[part] = JSON.parse(value); - } catch { + if (typeof value === "string" && /^[\[{]/.test(value.trim())) { + try { + current[part] = JSON.parse(value); + } catch { + current[part] = value; + } + } else { current[part] = value; } } else { - // Intermediate part — create object if needed current[part] = current[part] || {}; current = current[part]; } } } - return result; }