Skip to content

Commit

Permalink
changed id reference
Browse files Browse the repository at this point in the history
  • Loading branch information
qiandrewj committed May 7, 2024
1 parent 4dca0b0 commit 7468ebe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client/src/modules/Admin/Components/ManageAdminModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ const ManageAdminModal = ({token, open, setOpen}: Props) => {
function removeAdmin(user: Student) {
axios
.post('/api/removeAdmin', {
userId: user._id,
userId: user.netId,
token: token
})
.then((response) => {
if (response.status === 200) {
const updatedAdmins = admins.filter((admin: Student) => {
return admin && admin._id !== user._id
return admin && admin._id !== user.netId
})
setAdmins(updatedAdmins)
}
Expand Down
2 changes: 1 addition & 1 deletion server/src/admin/admin.data-access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const findAdminUsers = async () => {
}

export const removeAdminPrivilege = async (id: string) => {
const res = await Students.updateOne({ _id: id }, { $set: {privilege: 'regular'} }).exec()
const res = await Students.updateOne({ netid: id }, { $set: {privilege: 'regular'} }).exec()
return res
}

Expand Down

0 comments on commit 7468ebe

Please sign in to comment.