✅ REST Create-endpoint best practice.
I am creating an endpoint to add a user. The Users table is related with the Roles table. How should I implement the transfer of the user's role: accept a string with the name of the role, and throw an error if there is no such role? Or accept role id and have an endpoint to get all roles?
2 Replies
if your roles HAVE IDs, you should use those
identify entities by their primary key
just in general
Thank you!