website cleanup
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { PendingRequestDTO } from '@/components/sponsors/PendingSponsorshipRequests';
|
||||
import type { SponsorshipRequestDTO } from '@/lib/types/generated/SponsorshipRequestDTO';
|
||||
|
||||
export class SponsorshipRequestViewModel {
|
||||
id: string;
|
||||
@@ -14,17 +14,18 @@ export class SponsorshipRequestViewModel {
|
||||
platformFee: number;
|
||||
netAmount: number;
|
||||
|
||||
constructor(dto: PendingRequestDTO) {
|
||||
constructor(dto: SponsorshipRequestDTO) {
|
||||
this.id = dto.id;
|
||||
this.sponsorId = dto.sponsorId;
|
||||
this.sponsorName = dto.sponsorName;
|
||||
this.sponsorLogo = dto.sponsorLogo;
|
||||
this.tier = dto.tier;
|
||||
// Backend currently returns tier as string; normalize to our supported tiers.
|
||||
this.tier = dto.tier === 'main' ? 'main' : 'secondary';
|
||||
this.offeredAmount = dto.offeredAmount;
|
||||
this.currency = dto.currency;
|
||||
this.formattedAmount = dto.formattedAmount;
|
||||
this.message = dto.message;
|
||||
this.createdAt = dto.createdAt;
|
||||
this.createdAt = new Date(dto.createdAt);
|
||||
this.platformFee = dto.platformFee;
|
||||
this.netAmount = dto.netAmount;
|
||||
}
|
||||
@@ -51,4 +52,4 @@ export class SponsorshipRequestViewModel {
|
||||
get tierBadgeVariant(): 'primary' | 'secondary' {
|
||||
return this.tier === 'main' ? 'primary' : 'secondary';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user