Repository navigation
refactor(api): type pages api routes against prisma - #1535
Code-Parth wants to merge 3 commits into
Conversation
Adds getErrorMessage, jsonResponse, parseQuestionAnswers, parseQuestionConfigs, getPaymentAmount and the skills and linkedTwitter parsers, and types the shared server utils against the Prisma models instead of any. No call sites in API routes change here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
catch clauses are unknown and narrowed, request bodies and JSON columns are parsed instead of cast. The OG image routes fall back to "?" when the name param is missing, and scout generation keeps existing scouts and returns early when the bounty has no matchable skills. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers every route under src/pages/api except the sponsor dashboard. catch clauses are unknown and narrowed, and request bodies, sessions and JSON columns use the Prisma models and route selects instead of casts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@Code-Parth is attempting to deploy a commit to the Superteam Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedToo many files! This PR contains 128 files, which is 28 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. CodeRabbit couldn't verify your organization's usage billing state, so no usage-priced review was started. Retry after the billing service recovers.
|
What does this PR do?
Types every route under
src/pages/apiexcept the sponsor dashboard against the Prisma models instead ofany(62 files: user, sponsors, listings, agents, submission, pow, grants, comment, feed, hackathon, member invites, auth).catchclauses areunknownand read throughgetErrorMessage.selects instead of casts.No intended behavior change.
Where should the reviewer start?
src/pages/api/auth/[...nextauth].ts, which now uses the typed session fields.src/pages/api/submission/create.tsandupdate.tssrc/pages/api/pow/edit.tsHow should this be manually tested?
pnpm check-typespasses andpnpm lintreports 0 errors.Any background context you want to provide?
Removes 87 explicit
any.What are the relevant issues?
None.
Screenshots (if appropriate)
None.
🤖 Generated with Claude Code