Skip to content

fix: Hero Update Dialog in Freelancer profile correctly updates user and profile fields - #32

Merged
prathmesh796 merged 1 commit into
mainfrom
ui
Sep 9, 2026
Merged

prathmesh796 merged 1 commit into
mainfrom
ui

Conversation

@prathmesh796

Copy link
Copy Markdown
Owner

Description

The hero section in Freelancer profile had name field from User model and remaining fields from Profile model. The name was not updated properly ecause of this. Had separately update the name field in Users.

Changes

  • Added a patch request to Users model, if name field was updated.
  • Removed "baseUrl" field from tsconfig, as it has been removed.
  • Corrected the Member Since section, to show only the date.

Copilot AI lite review requested due to automatic review settings September 9, 2026 04:42
@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
getlancer Ready Ready Preview Sep 9, 2026 4:42am UTC

@prathmesh796
prathmesh796 merged commit fcfbec8 into main Sep 9, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

There are verified correctness and reliability issues (tsconfig path alias config, a potential runtime crash in date rendering, and a partial-update bug in the PATCH handler) that should be addressed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR fixes profile editing inconsistencies by ensuring the Freelancer “Hero” edit flow updates the User.name field (separate from Fprofile), adjusts TypeScript config related to path aliasing, and formats the Client “Member Since” display to show only the date portion.

Changes:

  • Update Freelancer profile PATCH handler to also update the User document when the hero “name” is changed.
  • Remove baseUrl from tsconfig.json.
  • Format “Member Since” to show only the date (YYYY-MM-DD).
File summaries
File Description
tsconfig.json Removes baseUrl while keeping paths alias configuration.
app/api/profile/FreelancerProfile/route.ts Splits PATCH updates into profile fields vs user fields (name), and applies user update.
app/(Cinterface)/Cprofile/page.tsx Changes “Member Since” display to show only the date portion.
Review details
  • Files reviewed: 2/3 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

<div className="absolute top-0 right-0 w-32 h-32 bg-white/10 rounded-full -mr-16 -mt-16"></div>
<h3 className="text-sm font-semibold uppercase tracking-wide mb-2">Member Since</h3>
<p className="text-3xl font-bold">{user?.createdAt || "N/A"}</p>
<p className="text-3xl font-bold">{user?.createdAt.split('T')[0] || "N/A"}</p>
Comment on lines +321 to +322
console.log(updateProfileFields)
console.log(updateUserFields)
Comment on lines +334 to 340
if (Object.keys(updateUserFields).length > 0) {
await User.findByIdAndUpdate(userId, { $set: updateUserFields }, { new: true });
}

if (!updated) {
return NextResponse.json({ success: false, error: "Freelancer profile not found" }, { status: 404 });
}

This branch was successfully deployed

1 active deployment
Preview — e8853ee5 Deployed Sep 9, 2026 by vercel[bot]
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.

2 participants