-
Notifications
You must be signed in to change notification settings - Fork 1
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
Tidy up role controller endpoints. #172
Conversation
This renames the role endpoint from `/role` to `/roles`, bringing it inline with the existing `/packets` and `/packetGroups`. This also removes the `GET /roles/names` endpoint, which was not being used anywhere, and which overlapped with the existing `GET /roles/<name>` which is used to get details about a particular role. Having both routes could cause issue is a role was named `names`.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #172 +/- ##
==========================================
+ Coverage 97.18% 97.20% +0.02%
==========================================
Files 149 149
Lines 1422 1433 +11
Branches 406 416 +10
==========================================
+ Hits 1382 1393 +11
Misses 39 39
Partials 1 1 ☔ View full report in Codecov by Sentry. |
c18623a
to
106fa27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff, just one query.
@@ -26,8 +26,9 @@ interface DeleteUserOrRoleProps { | |||
export const DeleteUserOrRole = ({ mutate, data: { name, type } }: DeleteUserOrRoleProps) => { | |||
const onDelete = async (roleName: string) => { | |||
try { | |||
const endpoint = type === "role" ? "roles" : type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This suggests we should maybe pluralise the user
endpoints next!
Co-authored-by: Emma Russell <44669576+EmmaLRussell@users.noreply.github.com>
This renames the role endpoint from
/role
to/roles
, bringing it inline with the existing/packets
and/packetGroups
.This also removes the
GET /roles/names
endpoint, which was not being used anywhere, and which overlapped with the existingGET /roles/<name>
which is used to get details about a particular role. Having both routes could cause issue is a role was namednames
.