30 lines
662 B
TypeScript
30 lines
662 B
TypeScript
import { LeagueAdminViewModel } from '../dto/LeagueDto';
|
|
|
|
export class LeagueAdminPresenter {
|
|
private result: LeagueAdminViewModel | null = null;
|
|
|
|
reset() {
|
|
this.result = null;
|
|
}
|
|
|
|
present(data: {
|
|
joinRequests: any[];
|
|
ownerSummary: any;
|
|
config: any;
|
|
protests: any;
|
|
seasons: any[];
|
|
}) {
|
|
this.result = {
|
|
joinRequests: data.joinRequests,
|
|
ownerSummary: data.ownerSummary,
|
|
config: { form: data.config },
|
|
protests: data.protests,
|
|
seasons: data.seasons,
|
|
};
|
|
}
|
|
|
|
getViewModel(): LeagueAdminViewModel {
|
|
if (!this.result) throw new Error('Presenter not presented');
|
|
return this.result;
|
|
}
|
|
} |