Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Consolidate Admin User APIs #5050

Open
wants to merge 5 commits into
base: mealie-next
Choose a base branch
from

Conversation

michael-genson
Copy link
Collaborator

What this PR does / why we need it:

(REQUIRED)

We have two sets of admin user routes which do the same thing. I removed some so that we only have one route per function. This is a breaking change since I have removed routes, however the remaining routes have the same function signature, so if anyone is relying on these endpoints it's an easy migration:

  • GET /api/users -> GET /api/admin/users
  • POST /api/users -> POST /api/admin/users
  • GET /api/users/{item_id} -> GET /api/admin/users/{item_id}
  • DELETE /api/users/{item_id} -> DELETE /api/admin/users/{item_id}

Note: PUT /api/users/{item_id} still remains because this is the endpoint for all users to update their own info. Maybe down the line we change this to /self (similar to the GET API).

I also added some helpful error messages for if an admin tries to create a new user with an existing username and/or email (see: #2866).

Which issue(s) this PR fixes:

(REQUIRED)

Fixes #2866

Testing

(fill-in or delete this section)

Tested the frontend to make sure admin management still works, as well as all basic user management (e.g. updating your own profile).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] - Two users cannot have the same email address
1 participant