From 5d3ecf64290d426d0292fb2d003346f5e4a2f709 Mon Sep 17 00:00:00 2001 From: Varun Date: Mon, 3 Mar 2025 16:54:08 +0530 Subject: [PATCH] changes in view only --- src/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 37514d76..5402f540 100644 --- a/src/index.js +++ b/src/index.js @@ -252,8 +252,15 @@ fastify.post("/api/login", { }; if (loginObject.isStaff) { - responsePayload.simplydata.all_motor_access = loginObject.staffMember.all_motor_access; - } + let allMotorAccess = loginObject.staffMember.all_motor_access; + + // Normalize the value if it matches the given variations + if (["view", "view only", "View", "View Only"].includes(allMotorAccess)) { + allMotorAccess = "view"; + } + + responsePayload.simplydata.all_motor_access = allMotorAccess; + } if (profilePicture) { responsePayload.simplydata.picture = profilePicture.picture;