From 88c8dc48aea791879d1a4831588bf7abf3d331a5 Mon Sep 17 00:00:00 2001 From: Nathan Lamy Date: Tue, 24 Feb 2026 23:22:12 +0100 Subject: [PATCH] feat: add merge user component --- app/components/settings/profile.tsx | 21 ++++++++++++--------- app/lib/api.ts | 3 ++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/app/components/settings/profile.tsx b/app/components/settings/profile.tsx index 6444836..8ac4a8e 100644 --- a/app/components/settings/profile.tsx +++ b/app/components/settings/profile.tsx @@ -66,15 +66,18 @@ export default function Profile({ user }: { user: User }) { - - - { - window.location.reload(); - }} - /> + {!user.pastStudentId && ( + <> + + { + window.location.reload(); + }} + /> + + )} diff --git a/app/lib/api.ts b/app/lib/api.ts index 1304684..7a2531f 100644 --- a/app/lib/api.ts +++ b/app/lib/api.ts @@ -97,7 +97,7 @@ export const getStudentMatch = async ( }; export const mergeStudent = async (studentId: string) => { - return makePostRequest("/api/merge-student", { studentId }); + return makePostRequest("/api/merge-student", { pastStudentId: studentId }); }; /** @@ -118,6 +118,7 @@ const defaultUser = { email: "", className: "", preferences: [] as UserPreferences, + pastStudentId: null as string | null, }; export type User = typeof defaultUser;