t00-multiuser/server/controller/AdminController.ts
2024-09-26 00:47:08 +01:00

33 lines
No EOL
1,011 B
TypeScript

import AdminIndexViewModel from "../models/admin/AdminIndexViewModel";
import AdminPartiesViewModel from "../models/admin/AdminPartiesViewModel";
import AdminUsersViewModel from "../models/admin/AdminUsersViewModel";
import PartyService from "../services/PartyService";
import UserService from "../services/UserService";
import Controller from "./Controller";
export default class AdminController_Auth$Admin extends Controller {
public async Index_Get() {
const adminIndexViewModel: AdminIndexViewModel = {
userCount: await UserService.GetUserCount(),
partyCount: await PartyService.GetPartyCount()
};
return this.view(adminIndexViewModel);
}
public async Users_Get() {
const adminUsersViewModel: AdminUsersViewModel = {
users: await UserService.GetAll()
};
return this.view(adminUsersViewModel);
}
public async Parties_Get() {
const adminPartiesViewModel: AdminPartiesViewModel = {
parties: await PartyService.GetAll()
};
return this.view(adminPartiesViewModel);
}
}