Closed wacii closed 6 years ago
I'm not great at design either, but maybe it could be a checkbox in with the rest of the form?
The toggle is now a checkbox. Remember thinking earlier that it would be better to have the toggle separate from the edit user form, but I can't remember why, so it must not have been a very good reason.
This PR is now dependent on #341. Something I had to fix to get this to work.
Cool, it looks a bit weird with the label above and nothing next to the checkbox though, you can add text next to the checkbox with options={"the text"}
.
It also complains user.save is not a function
because in user profile update, user can just be an object not a mongoose model.
Oh right. .lean()
returns a plain javascript object. My mistake.
I removed the label and put text next to the checkbox.
I finished cleaning up the old routes.
This adds the ability to promote/demote users to/from admin status. Admins can't demote themselves. Although they're not prevented from trying, only told after the fact that they can't with an error message.
Could use some input on design/where exactly you want this feature. I'm real bad at design.