30 lines
1.1 KiB
JavaScript
30 lines
1.1 KiB
JavaScript
import Project from '#models/project';
|
|
import Category from '#models/category';
|
|
import Tag from '#models/tag';
|
|
import Training from '#models/training';
|
|
import Music from '#models/music';
|
|
import Information from '#models/information';
|
|
import Experience from '#models/experience';
|
|
export default class DashboardController {
|
|
async index({ view }) {
|
|
const [projects, categories, tags, trainings, musics, experiences] = await Promise.all([
|
|
Project.all(),
|
|
Category.all(),
|
|
Tag.all(),
|
|
Training.all(),
|
|
Music.all(),
|
|
Experience.all(),
|
|
]);
|
|
const info = await Information.first();
|
|
return view.render('admin/dashboard', {
|
|
projectsCount: projects.length,
|
|
categoriesCount: categories.length,
|
|
tagsCount: tags.length,
|
|
trainingsCount: trainings.length,
|
|
musicsCount: musics.length,
|
|
experiencesCount: experiences.length,
|
|
hasInformation: !!info,
|
|
});
|
|
}
|
|
}
|
|
//# sourceMappingURL=dashboard_controller.js.map
|