From 146d0d0d836490e5f2ca2689cfc76b7bac5274b5 Mon Sep 17 00:00:00 2001 From: Zejing Yu Date: Tue, 26 Dec 2023 00:13:36 +0800 Subject: [PATCH] Fix role and authName in updateUser function --- src/components/Admin/ProfileCard.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/Admin/ProfileCard.jsx b/src/components/Admin/ProfileCard.jsx index 382054d..c87161b 100644 --- a/src/components/Admin/ProfileCard.jsx +++ b/src/components/Admin/ProfileCard.jsx @@ -32,6 +32,12 @@ function ProfileCard({ mode, person, onClose }) { const updateUser = async (id, userData) => { try { + if (userData.role === 'User') { + userData.role = 'Employee'; + } + if (userData.authName === 'N/A') { + userData.authName = null; + } const response = await fetch(`${API_URL}/${id}`, { method: 'PUT', headers: {