Initial commit
This commit is contained in:
30
app/controllers/admin/dashboard_controller.js
Normal file
30
app/controllers/admin/dashboard_controller.js
Normal file
@@ -0,0 +1,30 @@
|
||||
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
|
||||
Reference in New Issue
Block a user