Skip to content

Commit

Permalink
Merge pull request #20 from chenyu-01/Y
Browse files Browse the repository at this point in the history
Fix role and authName in updateUser function
  • Loading branch information
chenyu-01 authored Dec 25, 2023
2 parents be20b1f + 146d0d0 commit 7ceaed0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/Admin/ProfileCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 7ceaed0

Please sign in to comment.