Skip to content

infra: added basic GET APIs for paths and topics - #41

Open
Faisal-Waleed-Dawoud wants to merge 1 commit into
SJA-Pathway:devfrom
Faisal-Waleed-Dawoud:feature/basic-api-routes-for-paths-and-topics
Open

infra: added basic GET APIs for paths and topics#41
Faisal-Waleed-Dawoud wants to merge 1 commit into
SJA-Pathway:devfrom
Faisal-Waleed-Dawoud:feature/basic-api-routes-for-paths-and-topics

Conversation

@Faisal-Waleed-Dawoud

Copy link
Copy Markdown
Collaborator

Pull Request

What did you change?
I created 3 API routes containing GET methods for getting data.
paths API: gets the paths and returns Response.json so that it can be fetched in the page
pathSlug API: gets a specific path and returns Response.json containing its topics so that it can be fetched in the page
topicSlug API: gets a specific topic with its information and returns Response.json so that it can be fetched in the page

What issue does this fix?
#16

Checklist:
-[ Yes ] I tested my code locally
-[ Yes ] My code works
-[ Yes ] I didn't break anything else

Co-authored-by: Copilot <copilot@github.com>
@abdullah-builds-dev

Copy link
Copy Markdown
Collaborator

Hi @Faisal-Waleed-Dawoud , thanks for setting up the API routes. The use of await params is correct in Next.js 15. However, I noticed a few issues:
– Avoid hardcoding http://localhost:3000 in fetch calls; use relative paths.
– Returning Response.json(false) isn’t ideal; please return a proper status code.
– Some pages still mix direct data calls with API fetches — better to rely on the API consistently.
Please fix these points and re‑request review

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.

2 participants