Skip to content

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).

Copy link
Contributor

github-actions bot commented May 4, 2025

This PR is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the stale label May 4, 2025
@github-actions github-actions bot removed the stale label Jun 18, 2025
@Kuchenpirat Kuchenpirat enabled auto-merge (squash) June 30, 2025 10:04
@Kuchenpirat Kuchenpirat merged commit 47eb1eb into mealie-recipes:mealie-next Jun 30, 2025
15 checks passed
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
2 participants