Skip to content
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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

devkiran
Copy link
Collaborator

No description provided.

Copy link

vercel bot commented Mar 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
dub ❌ Failed (Inspect) Apr 8, 2025 5:47am

@devkiran devkiran marked this pull request as ready for review March 27, 2025 06:56
Copy link
Contributor

@Copilot Copilot AI left a 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) {

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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.

None yet

2 participants