From 07d24fc7a08276076495d90e1e0274a141acddbd Mon Sep 17 00:00:00 2001
From: alex <alex@alexloehr.net>
Date: Thu, 08 Oct 2026 16:00:15 +0000
Subject: [PATCH] GS-2555

---
 lib/libIlias.js |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/libIlias.js b/lib/libIlias.js
index 180fb45..37b4108 100644
--- a/lib/libIlias.js
+++ b/lib/libIlias.js
@@ -85,14 +85,16 @@
 
    const udfDef = await db.getUdf()
    const udfMap = _.keyBy(udfDef, "field_name")
-   // console.dir(udfMap, {depth: null, colors: true, maxArrayLength: null})
-   user.udf = _.mapKeys(user.udf, function (value, key) {
+
+   // do not mutate the caller's user object
+   const user2 = _.cloneDeep(user)
+   user2.udf = _.mapKeys(user.udf, function (value, key) {
       return udfMap[key].field_id
    })
 
    const res = await fetch(url2, {
       method: "POST",
-      body: JSON.stringify(user)
+      body: JSON.stringify(user2)
    })
    const text = await res.text()
    try {

--
Gitblit v1.8.0