view models
This commit is contained in:
@@ -1,13 +1,22 @@
|
||||
import { SponsorDto } from '../dtos';
|
||||
// Note: No generated DTO available for Sponsor yet
|
||||
interface SponsorDTO {
|
||||
id: string;
|
||||
name: string;
|
||||
logoUrl?: string;
|
||||
websiteUrl?: string;
|
||||
}
|
||||
|
||||
export class SponsorViewModel implements SponsorDto {
|
||||
export class SponsorViewModel {
|
||||
id: string;
|
||||
name: string;
|
||||
logoUrl?: string;
|
||||
websiteUrl?: string;
|
||||
|
||||
constructor(dto: SponsorDto) {
|
||||
Object.assign(this, dto);
|
||||
constructor(dto: SponsorDTO) {
|
||||
this.id = dto.id;
|
||||
this.name = dto.name;
|
||||
if (dto.logoUrl !== undefined) this.logoUrl = dto.logoUrl;
|
||||
if (dto.websiteUrl !== undefined) this.websiteUrl = dto.websiteUrl;
|
||||
}
|
||||
|
||||
/** UI-specific: Display name */
|
||||
|
||||
Reference in New Issue
Block a user