league service
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user