site icon indicating copy to clipboard operation
site copied to clipboard

Add endpoint to fetch filters in JSON format

Open jchristgit opened this issue 1 year ago • 4 comments

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.

jchristgit avatar Dec 10 '23 17:12 jchristgit

Deploy Preview for pydis-static ready!

Name Link
Latest commit c63ab0be5add5f37a11c3e8a7de33bb75a3eccae
Latest deploy log https://app.netlify.com/sites/pydis-static/deploys/66acd9bb1a208e00088dc1fe
Deploy Preview https://deploy-preview-1166--pydis-static.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Dec 10 '23 17:12 netlify[bot]

Coverage Status

coverage: 100.0%. remained the same when pulling c63ab0be5add5f37a11c3e8a7de33bb75a3eccae on resource-filter-fetch into e51d80a99876724283a1aefea3b11a803329c4af on main.

coveralls avatar Dec 10 '23 17:12 coveralls

@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 slug field for the respective category, and the filter_slugs field for each filter. To be specific, filter_slugs[3] == to_kebabcase(slugs[3]). Let me know what you think.

jchristgit avatar Jun 14 '24 16:06 jchristgit

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.

jchristgit avatar Aug 02 '24 14:08 jchristgit