-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Select preferred format for displaying links in the partner portal #2215
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the partner portal to use a new LinkStructure format throughout the codebase. The key changes include adding LinkStructure to the Prisma client, updating Zod schemas to use z.nativeEnum(LinkStructure), and revising both backend actions and frontend components to handle link structures consistently.
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/prisma/client.ts | Added export for LinkStructure |
apps/web/lib/zod/schemas/programs.ts | Updated schema to include linkStructure using z.nativeEnum |
apps/web/lib/zod/schemas/program-onboarding.ts | Replaced linkType with linkStructure and adjusted default value |
apps/web/lib/link-structures.ts | Introduced helper to generate link structure examples |
apps/web/lib/actions/partners/update-program.ts | Modified error handling logic and added linkStructure parameter |
apps/web/lib/actions/partners/create-program.ts | Updated to include new linkStructure in program creation |
Various frontend components | Updated form fields, radio inputs, and link display logic to use linkStructure instead of linkType |
apps/web/app/api/partner-profile/programs/[programId]/earnings/count/route.ts | Removed an unused variable and cleaned up logging |
Files not reviewed (1)
- packages/prisma/schema/program.prisma: Language not supported
Comments suppressed due to low confidence (2)
apps/web/lib/actions/partners/update-program.ts:98
- The error handling was changed from returning an error object to throwing an error. Please ensure that this change aligns with the overall error-handling strategy across similar actions, as it may affect how errors are caught and managed downstream.
throw new Error("Failed to update program.");
apps/web/app/partners.dub.co/(dashboard)/programs/[programSlug]/page-client.tsx:85
- [nitpick] Ensure that comparing program.linkStructure to the string "query" is consistent with the actual values in the LinkStructure enum. If LinkStructure is a native string enum, confirm that "query" is the correct value used across the codebase.
if (program?.url && program.linkStructure === "query" && masterLink) {
No description provided.