Skip to content

Commit

Permalink
Add src != dest user check to the migrateUser function (#5916)
Browse files Browse the repository at this point in the history
  • Loading branch information
themrrobert authored Jun 11, 2024
1 parent 9acdc8b commit 8b655e1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/util/migrateUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export async function migrateUser(_source: string | MUser, _dest: string | MUser
const sourceUser = typeof _source === 'string' ? await mUserFetch(_source) : _source;
const destUser = typeof _dest === 'string' ? await mUserFetch(_dest) : _dest;

if (sourceUser.id === destUser.id) {
throw new UserError('Destination user cannot be the same as the source!');
}

// First check for + cancel active GE Listings:
await Promise.all([cancelUsersListings(sourceUser), cancelUsersListings(destUser)]);

Expand Down

0 comments on commit 8b655e1

Please sign in to comment.