@@ -311,12 +311,8 @@ const userHelper = function () {
311311 `${ a . firstName } ${ a . lastName } ` . localeCompare ( `${ b . firstName } ${ b . lastName } ` ) ,
312312 ) ;
313313
314- < << << << sai / pause-user-permission-backend
315- for ( const result of results ) {
316- === = ===
317314 for ( let i = 0 ; i < activeResults . length ; i += 1 ) {
318315 const result = activeResults [ i ] ;
319- >>> > >>> development
320316 const {
321317 firstName,
322318 lastName,
@@ -2351,26 +2347,6 @@ const userHelper = function () {
23512347 const masterBadges = await badge . find ( { type : 'Personal Max' } ) ;
23522348 if ( ! masterBadges . length ) return ;
23532349
2354- < << << << sai / pause-user-permission-backend
2355- // Check for existing badge in badgeCollection
2356- for ( let i = 0 ; i < badgeCollection . length ; i += 1 ) {
2357- const b = badgeCollection [ i ] ;
2358- if ( b . badge ?. type === 'Personal Max' ) {
2359- console . log ( `[DEBUG] Found Personal Max badge at index $` ) ;
2360- if ( badgeOfType ) {
2361- duplicateBadges . push ( b ) ;
2362- console . log ( `[DEBUG] Found duplicate Personal Max badge:)}` ) ;
2363- } else {
2364- badgeOfType = b ;
2365- }
2366- break ;
2367- }
2368- }
2369-
2370- // Remove duplicate badges
2371- for ( const b of duplicateBadges ) {
2372- await removeDupBadge ( personId , b . _id ) ;
2373- = === ===
23742350 const masterBadgeId = masterBadges [ 0 ] . _id ;
23752351
23762352 // Collect all Personal Max badges from the user's collection
@@ -2379,7 +2355,6 @@ const userHelper = function () {
23792355 // Remove all duplicates beyond the first
23802356 for ( let i = 1 ; i < personalMaxBadges . length ; i += 1 ) {
23812357 await removeDupBadge ( personId , personalMaxBadges [ i ] . _id ) ;
2382- > >>> >>> development
23832358 }
23842359
23852360 const badgeOfType = personalMaxBadges [ 0 ] || null ;
0 commit comments