Skip to content

add APIs for getting toolbox items#271

Draft
Mahmoud1205 wants to merge 1 commit into
hackclub:mainfrom
Mahmoud1205:main
Draft

add APIs for getting toolbox items#271
Mahmoud1205 wants to merge 1 commit into
hackclub:mainfrom
Mahmoud1205:main

Conversation

@Mahmoud1205
Copy link
Copy Markdown

fixes #190
there are two new APIs: GetCategories which returns a list of categories with their names and IDs.
and GetItems which returns a list of items from a category ID. or all the categories if a category ID wasn't selected
the API is very simple but i will upgrade it soon if this PR gets merged.

@Mahmoud1205 Mahmoud1205 requested a review from a team May 14, 2026 19:09
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

@Mahmoud1205 is attempting to deploy a commit to the Hack Club Team on Vercel.

A member of the Team first needs to authorize it.

@whatbeato
Copy link
Copy Markdown
Contributor

hey, thanks for the pr! before this can be merged there are a few things that need to be fixed though:

the category IDs aren't stable - you're using the array index as the ID, so if anyone reorders the manifest the IDs shift and GetItems starts returning the wrong data. there's no actual ID field on manifest entries so this whole concept is a bit fragile.

GetItems has inconsistent response shapes - if you don't pass a category, it returns { categories: manifest } (the whole manifest), but if you do pass one, it returns the full category object including color, icon, etc. instead of just the items. the endpoint is called GetItems so it should probably just return items. the two cases should return the same shape.

file naming - Next.js API routes are conventionally lowercase or kebab-case, not PascalCase. GetCategories.js -> get-categories.js, etc.

the yarn.lock diff is huge (+360/-695) - can you explain what changed there? dependency changes need to be intentional, not a side effect of running install with a different node version.

brace style is inconsistent between the two files. pick one and stick to it.

great work, but it just needs a bit of cleanup before it's ready to merge! i've marked it as a draft for now :)

@whatbeato whatbeato marked this pull request as draft May 16, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API to list toolbox items

2 participants