Skip to content

fix(admin-api): give route handlers the context argument Next.js requires - #510

Merged
KMKoushik merged 1 commit into
mainfrom
hq/fix-admin-route-types
Nov 15, 2026
Merged

KMKoushik merged 1 commit into
mainfrom
hq/fix-admin-route-types

Conversation

@KMKoushik

@KMKoushik KMKoushik commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Fixes the failed Railway build after #499: next build rejects route handlers whose second argument is optional (Expected "RouteContext", got "undefined"). The typecheck and tests don't run this check; only the production build does.

  • adminApiRoute now takes context: { params: Promise<Params> } (required), as Next.js 15 expects.
  • The API test passes the context.

Verified locally: pnpm build:editor && pnpm build:web passes (29/29 pages), typecheck clean, 344 unit / 23 tRPC / 49 API tests pass.

Follow-up: add the production build to the web CI workflow so this class of error fails CI.

Ask Polylane for an impact assessment of this pull request:

Assess with Polylane


Summary by cubic

Fixes the failed Railway build: Next.js 15 requires route handlers to accept a required context argument, so the optional second parameter in adminApiRoute broke next build even though typecheck and tests passed.

  • adminApiRoute now requires context: { params: Promise<Params> }.
  • The admin feedback API test now passes a resolved context to route handlers.
  • Verified locally: builds pass, typecheck clean, and all 344 unit / 23 tRPC / 49 API tests pass.

Follow-up: add the production build to the web CI workflow so this class of error fails CI.

Written for commit fe7debb. Summary will update on new commits.

View guided diff Turn on auto-fix

@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
unsend-marketing Ready Ready Preview Nov 15, 2026 10:48pm UTC

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/web/src/app/api/admin/feedback/route.api.test.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

apps/web/src/server/admin-api.ts

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying usesend with  Cloudflare Pages  Cloudflare Pages

Latest commit: fe7debb
Status: ✅  Deploy successful!
Preview URL: https://02f97c3f.usesend.pages.dev
Branch Preview URL: https://hq-fix-admin-route-types.usesend.pages.dev

View logs

@KMKoushik
KMKoushik merged commit 34409dd into main Nov 15, 2026
6 checks passed
@KMKoushik
KMKoushik deleted the hq/fix-admin-route-types branch November 15, 2026 22:49

This branch was successfully deployed

1 active deployment
Preview — fe7debb3 Deployed Nov 15, 2026 by vercel[bot]
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.

1 participant