-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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: create an admin return all agents route #1620
feat: create an admin return all agents route #1620
Conversation
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.
LGTM
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.
Actually sorry can you run the linter code first? Looks like that test is failing, otherwise the main logic LGTM though.
You can run the linter via precommit, see OP in this PR:
#1300
design note - typically the way you'd want to handle this is via auth. an admin auth token would return all agents on list, whereas a normal user auth token would return the agents scoped to them. then for list queries if it takes query strings the admin would be able to do so maybe a one-off for now, but should definitely consider auth-scoped list endpoints to replace it |
I am not sure if I agree here; the If you wanted an alternative crud solution I'd say you want to map your endpoints like this:
Then we can add our query params to the end of it for filtering I think overall we should probably do a bit of restful improvement here though I agree! |
Please describe the purpose of this pull request.
Attempts to address this issue by adding a new endpoint that will return all agents, regardless of user behind an
/api/admin
endpoint.How to test
You can pull down the code and run this command to test:
Have you tested this PR?
Yes
Related issues or PRs
[Please link any related GitHub issues or PRs.
](#1522)
Is your PR over 500 lines of code?
No
Additional context
Add any other context or screenshots about the PR here.