Repository navigation
refactor(api): type sponsor dashboard api routes against prisma - #1536
Code-Parth wants to merge 4 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>
catch clauses are unknown and narrowed, and listing rewards, payment details and export rows use typed shapes instead of any. Payment history stored in an unexpected shape is now refused with an error instead of being treated as empty and overwritten on the next payment. 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 156 files, which is 56 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 the routes under
src/pages/api/sponsor-dashboardagainst the Prisma models instead ofany(28 files).catchclauses areunknownand read throughgetErrorMessage.paymentDetailsentries and the export-sheet rows use typed shapes instead ofany.One behavior change: payment history stored in an unexpected shape is refused with an error instead of being treated as empty. Before, a non-array
paymentDetailsvalue was replaced by the next payment write. This applies tosubmission/add-payment.tsandlistings/verify-external-payment.ts. A malformed entry counts as 0 in totals instead of producingNaN.Where should the reviewer start?
src/pages/api/sponsor-dashboard/submission/add-payment.tssrc/pages/api/sponsor-dashboard/listings/verify-external-payment.tssrc/pages/api/sponsor-dashboard/submission/export-sheets.tsHow should this be manually tested?
main.pnpm check-typespasses andpnpm lintreports 0 errors.Any background context you want to provide?
Removes 69 explicit
any.grants/update-application-status.tsis not changed here.What are the relevant issues?
None.
Screenshots (if appropriate)
None.
🤖 Generated with Claude Code