code quality
This commit is contained in:
@@ -38,6 +38,17 @@ export class SponsorshipService implements Service {
|
||||
async getSponsorSponsorships(sponsorId: string): Promise<SponsorSponsorshipsViewModel | null> {
|
||||
const data = await this.apiClient.getSponsorships(sponsorId);
|
||||
if (!data) return null;
|
||||
return new SponsorSponsorshipsViewModel(data);
|
||||
|
||||
const mappedData = {
|
||||
...data,
|
||||
sponsorships: data.sponsorships.map(s => ({
|
||||
...s,
|
||||
type: 'league', // DTO missing type
|
||||
entityName: s.leagueName, // DTO missing entityName
|
||||
price: s.amount // DTO missing price
|
||||
}))
|
||||
};
|
||||
|
||||
return new SponsorSponsorshipsViewModel(mappedData as any);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user