Repository navigation
refactor(types): type sponsor dashboard and listings against prisma - #1538
Code-Parth wants to merge 6 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>
Approving several applications at once could store one application's amount on another. Updates were pushed after awaiting token prices, so array order did not match the applications, and amounts were read from the request by index even though findMany with `in` does not return rows in request order. Updates are now returned from Promise.all and amounts are matched by application id. applicationStatus is validated against the Prisma enum, so an invalid status returns 400 instead of failing inside the transaction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces explicit any in the sponsor dashboard, listing builder and listing pages with the Prisma models, enums and route selects. Nullable columns are `| null` on the user, listing and hackathon types these screens read, and the components and hooks that receive them accept null. Fields the API never returns are removed from User (talent, sponsor, subSkills). Legacy listings that stored rewards as an array are numbered from 1 when loaded into the builder, so they pass validation on edit. 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 257 files, which is 157 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?
Replaces explicit
anyin the sponsor dashboard, listing builder and listing pages with the Prisma models, enums and routeselects (100 files).| nullon the user, listing and hackathon types these screens read, matching what the API sends. The components and hooks that receive them acceptnull.User:talent,sponsorandsubSkills.These areas share the user, listing and hackathon types. Making those nullable reaches into every screen that reads them, so they are changed together.
Where should the reviewer start?
src/features/listings/types/index.ts,src/features/listing-builder/types/index.tsandsrc/interface/user.ts, the shared types.src/features/listing-builder/utils/form.ts, where legacy array rewards are handled.src/features/sponsor-dashboard/queries/, the typed query results.How should this be manually tested?
pnpm check-typespasses andpnpm lintreports 0 errors.Any background context you want to provide?
Removes 107 explicit
any. Twoanystay inVerifyPayment.tsx, each with a reason on the line: react-hook-form's.rooterror paths are not in its types.What are the relevant issues?
None.
Screenshots (if appropriate)
None; no visual change.
🤖 Generated with Claude Code