File tree Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,10 @@ import { Role } from 'src/core/auth/auth.constants';
10
10
import { Roles , User } from 'src/core/auth/decorators' ;
11
11
import { UserInfo } from 'src/dto/user.type' ;
12
12
import { ResponseDto , ResponseStatusType } from 'src/dto/api-response.dto' ;
13
- import { WalletDetailDto , walletDetailResponseExample } from 'src/dto/wallet.dto' ;
13
+ import {
14
+ WalletDetailDto ,
15
+ walletDetailResponseExample ,
16
+ } from 'src/dto/wallet.dto' ;
14
17
15
18
import { WalletService } from './wallet.service' ;
16
19
Original file line number Diff line number Diff line change @@ -7,10 +7,7 @@ import { ResponseDto } from 'src/dto/api-response.dto';
7
7
import { WinningsType } from 'src/dto/winning.dto' ;
8
8
import { TaxFormRepository } from '../repository/taxForm.repo' ;
9
9
import { PaymentMethodRepository } from '../repository/paymentMethod.repo' ;
10
- import {
11
- RecipientTaxDetails ,
12
- TrolleyService ,
13
- } from 'src/shared/global/trolley.service' ;
10
+ import { TrolleyService } from 'src/shared/global/trolley.service' ;
14
11
15
12
/**
16
13
* The winning service.
@@ -36,10 +33,12 @@ export class WalletService {
36
33
} ) ;
37
34
38
35
if ( ! recipient ) {
39
- return { } as RecipientTaxDetails ;
36
+ return ;
40
37
}
41
38
42
- return this . trolleyService . getRecipientTaxDetails ( recipient . trolley_id ) ;
39
+ return await this . trolleyService . getRecipientTaxDetails (
40
+ recipient . trolley_id ,
41
+ ) ;
43
42
}
44
43
45
44
/**
@@ -87,7 +86,7 @@ export class WalletService {
87
86
taxForm : {
88
87
isSetupComplete : hasActiveTaxForm ,
89
88
} ,
90
- ...taxWithholdingDetails ,
89
+ ...( taxWithholdingDetails ?? { } ) ,
91
90
} ;
92
91
} catch ( error ) {
93
92
this . logger . error ( 'Getting winnings audit failed' , error ) ;
Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ export class TrolleyService {
177
177
178
178
async getRecipientTaxDetails (
179
179
recipientId : string ,
180
- ) : Promise < RecipientTaxDetails > {
180
+ ) : Promise < RecipientTaxDetails | void > {
181
181
try {
182
182
const recipient = await this . client . recipient . find ( recipientId ) ;
183
183
return pick ( recipient , [
@@ -190,7 +190,6 @@ export class TrolleyService {
190
190
'Failed to load recipient tax details from trolley!' ,
191
191
error ,
192
192
) ;
193
- return { } as RecipientTaxDetails ;
194
193
}
195
194
}
196
195
}
You can’t perform that action at this time.
0 commit comments