From d6729db9e663ea61f0937971939d007f2e931e3d Mon Sep 17 00:00:00 2001 From: Antlion12 Date: Mon, 9 Dec 2024 01:14:54 -0800 Subject: [PATCH] Remove lines that would delete unchosen and rejected legacy profiles. --- apps/api/src/routes/users.ts | 1 - apps/api/src/utils/user.ts | 22 ---------------------- 2 files changed, 23 deletions(-) diff --git a/apps/api/src/routes/users.ts b/apps/api/src/routes/users.ts index fd33f11e..91128c30 100644 --- a/apps/api/src/routes/users.ts +++ b/apps/api/src/routes/users.ts @@ -321,7 +321,6 @@ export const usersRoutes = } if (rejected) { - await clearLegacyUser({ db, legacyProfile }); const [profile, socialAccounts, notificationSettings] = await Promise.all([ db.userProfile.upsert({ diff --git a/apps/api/src/utils/user.ts b/apps/api/src/utils/user.ts index 2bb4cdb6..ba62959b 100644 --- a/apps/api/src/utils/user.ts +++ b/apps/api/src/utils/user.ts @@ -374,33 +374,11 @@ export const migrateLegacyUser = async ({ data: { userId, legacyProfileMigratedAt: new Date(), - // // Preserve legacy info for historical purposes. - // legacyAddress: null, - // legacyEmail: null, - // legacyEmailVerifiedAt: null, }, select: USER_PROFILE_SELECT_FIELDS, }); } - // Delete any other legacy records that weren't migrated - await db.$transaction([ - db.userProfile.deleteMany({ - where: { - legacyAddress: legacyProfile.legacyAddress, - }, - }), - ...(legacyProfile.email - ? [] - : [ - db.userProfile.deleteMany({ - where: { - legacyEmail: legacyProfile.legacyEmail, - }, - }), - ]), - ]); - return { updatedProfile, updatedSocialAccounts,