File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
apps/api/src/services/survey Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -431,17 +431,17 @@ function surveyService({
431
431
432
432
const urls = redirectPrompts . reduce < string | null | Record < string , string > > (
433
433
( acc , { id, identifier, url } ) => {
434
- let identifierValue : string | null ;
434
+ let identifierValue : string | undefined ;
435
435
switch ( identifier ) {
436
436
case 'userId' :
437
437
identifierValue = user . id ;
438
438
break ;
439
439
case 'username' :
440
440
case 'urlAuthToken' :
441
- identifierValue = aliases . length ? aliases [ 0 ] [ identifier ] : null ;
441
+ identifierValue = aliases . at ( 0 ) ?. [ identifier ] ;
442
442
break ;
443
443
default :
444
- identifierValue = customFields . length ? customFields [ 0 ] . value : null ;
444
+ identifierValue = customFields . find ( field => field . name === identifier ) ?. value ;
445
445
break ;
446
446
}
447
447
You can’t perform that action at this time.
0 commit comments