Skip to content

Duplicated link properties#2103

Merged
mfts merged 1 commit intomainfrom
cursor/duplicated-link-properties-b1a0
Mar 6, 2026
Merged

Duplicated link properties#2103
mfts merged 1 commit intomainfrom
cursor/duplicated-link-properties-b1a0

Conversation

@mfts
Copy link
Owner

@mfts mfts commented Mar 5, 2026

Duplicate custom form fields and visitor groups when duplicating a link to ensure all link properties are copied.


Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features
    • Link duplication now copies custom fields and visitor groups alongside the main link configuration.

When a link is duplicated, the custom form fields and visitor group
associations were not being copied to the new link. This adds:

- Include customFields and visitorGroups in the Prisma query for the
  source link
- Create new CustomField records for the duplicated link via createMany
- Create new LinkVisitorGroup junction records for the duplicated link
- Return customFields and visitorGroups in the created link response

Co-authored-by: Marc Seitz <mfts@users.noreply.github.com>
@cursor
Copy link

cursor bot commented Mar 5, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link

vercel bot commented Mar 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
papermark Ready Ready Preview, Comment Mar 5, 2026 2:24pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bc3c74bf-d8a8-4934-a1f5-a67d32ee7b77

📥 Commits

Reviewing files that changed from the base of the PR and between 8811f3a and 1b4e376.

📒 Files selected for processing (1)
  • pages/api/links/[id]/duplicate.ts

Walkthrough

The change extends link duplication functionality to also clone customFields and visitorGroups. The query now retrieves these fields, and during link creation, conditional logic creates related customFields and visitorGroups records as needed.

Changes

Cohort / File(s) Summary
Link Duplication Enhancement
pages/api/links/[id]/duplicate.ts
Extended link duplication to include customFields and visitorGroups. Query selection expanded to retrieve these fields, and conditional createMany logic added to duplicate related records during link creation. Core permissionGroup duplication logic unchanged.

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Duplicated link properties' directly summarizes the main change: enabling duplication of custom form fields and visitor groups when duplicating a link.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mfts mfts merged commit 3cf4458 into main Mar 6, 2026
10 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants