-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
Add endpoint to fetch filters in JSON format #1166
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for pydis-static ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
The response format here doesn't seem ideal. My understanding is that "filters" is the display name, and "valid_filters" is what goes in the URL(?), but the response doesn't link these together.
We could link them together in the structure, along the lines of this:
[
{
"name": "Difficulty",
"query_param": "difficulty",
"options": [
{"name": "Beginner", "query_value": "beginner"},
...
],
"icon": "fas fa-brain",
"hidden": false,
},
...
]
Alternatively we could maybe just drop the "valid_filters" section and document the transformation to get from the name to the url.
ec96414
to
fcc97ea
Compare
@wookie184 thanks for the review and sorry for the long delay. I've updated the response format, the "sluggified" / "kebabified" version of the names can now be found in the |
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 seems to undo the fix for #1209, I think it will cause performance issues.
2c5c2dc
to
7997f98
Compare
While this is an API endpoint consumed by the bot, keep it in the `resources` app instead of the `api` app, as all the logic and data for resources is contained within the `resources` app and we don't want to start messing around with that. The response format from the endpoint is as follows: { "topics": [ "algorithms-and-data-structures", "data-science", "databases", "discord-bots", "game-development", "general", "microcontrollers", "security", "software-design", "testing", "tooling", "user-interface", "web-development", "other" ], "payment_tiers": [ "free", "paid", "subscription" ], "type": [ "book", "community", "course", "interactive", "podcast", "project-ideas", "tool", "tutorial", "video" ], "difficulty": [ "beginner", "intermediate" ] } Closes #710.
7997f98
to
c63ab0b
Compare
Looks like I managed to mess up during rebasing. It should all be fine now, and the code should be a lot simpler thanks to Rohan's changes. Please also see the new response file format. |
While this is an API endpoint consumed by the bot, keep it in the
resources
app instead of theapi
app, as all the logic and data forresources is contained within the
resources
app and we don't want tostart messing around with that.
The response format from the endpoint is as follows:
Closes #710.