Next.js Discord

Discord Forum

Having issues with my API router, and I can't figure it out at ALL

Answered
Crème D’Argent posted this in #help-forum
Open in Discord
Crème D’ArgentOP
So for some reason it keeps saying theOrder is null, when I'm very clearly passing in an ID in the URL. You can see in the second image that I'm passing the data.id in the second page, I also console logged data.id and the JSON was valid. Now the Payment page takes the id that was passed in, which was showin in the second image, and it sends a POST request to the create-intent of Stripe. You can see in the 4th image, that its sending an error code 500 and I have absolutely 0 idea why
Answered by DirtyCajunRice | AppDir
params is the second param not the first

POST(req: NextRequest, { params })
View full answer

2 Replies

params is the second param not the first

POST(req: NextRequest, { params })
Answer
@DirtyCajunRice | AppDir params is the second param not the first POST(req: NextRequest, { params })
Crème D’ArgentOP
Oh yea sorry, completely forgot to close this post 😅