Skip to content
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

feat(nextjs): Add method and url to route handler request data #14084

Merged
merged 4 commits into from
Oct 29, 2024

Conversation

onurtemizkan
Copy link
Collaborator

@onurtemizkan onurtemizkan commented Oct 28, 2024

Resolves: #13908

Copy link

codecov bot commented Oct 28, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
634 1 633 33
View the top 1 failed tests by shortest run time
route-handlers.test.ts Should record exceptions and transactions for faulty route handlers
Stack Traces | 0.255s run time
route-handlers.test.ts:35:5 Should record exceptions and transactions for faulty route handlers

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

@onurtemizkan onurtemizkan force-pushed the onur/nextjs-route-handler-requestdata branch from 4cd8e8d to b7d1eed Compare October 29, 2024 08:59
@onurtemizkan onurtemizkan force-pushed the onur/nextjs-route-handler-requestdata branch from b7d1eed to 0659e96 Compare October 29, 2024 09:00
@onurtemizkan onurtemizkan marked this pull request as ready for review October 29, 2024 09:22
@onurtemizkan onurtemizkan requested a review from lforst October 29, 2024 09:22
@@ -60,6 +60,9 @@ test('Should record exceptions and transactions for faulty route handlers', asyn

expect(routehandlerError.exception?.values?.[0].value).toBe('route-handler-error');

expect(routehandlerError.request?.method).toBe('PUT');
expect(routehandlerError.request?.url).toContain('/route-handlers/[param]/error');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what we really need here is the unparameterized url. Which is a major pain in the butt to grab in Next.js because it turns static routes dynamic 🤔 Let me sit on this a bit.

@lforst lforst merged commit 06ef628 into develop Oct 29, 2024
146 checks passed
@lforst lforst deleted the onur/nextjs-route-handler-requestdata branch October 29, 2024 12:33
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.

POST request handled as GET in nextjs route handlers
2 participants