view data fixes
This commit is contained in:
@@ -1,20 +1,16 @@
|
||||
import type { LeagueScoringPresetDTO } from '@/lib/types/generated/LeagueScoringPresetDTO';
|
||||
|
||||
/**
|
||||
* View Model for league scoring presets
|
||||
* Transform from DTO to ViewModel with UI fields
|
||||
*/
|
||||
import { ViewModel } from "../contracts/view-models/ViewModel";
|
||||
import type { LeagueScoringPresetsViewData } from "../view-data/LeagueScoringPresetsViewData";
|
||||
|
||||
export class LeagueScoringPresetsViewModel extends ViewModel {
|
||||
presets: LeagueScoringPresetDTO[];
|
||||
presets: any[];
|
||||
totalCount: number;
|
||||
|
||||
constructor(dto: {
|
||||
presets: LeagueScoringPresetDTO[];
|
||||
totalCount?: number;
|
||||
}) {
|
||||
this.presets = dto.presets;
|
||||
this.totalCount = dto.totalCount ?? dto.presets.length;
|
||||
constructor(data: LeagueScoringPresetsViewData) {
|
||||
super();
|
||||
this.presets = data.presets;
|
||||
this.totalCount = data.totalCount ?? data.presets.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user