Replace 'stats' from artiste to new controller 'stats'

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-05-23 00:51:59 +04:00
parent 2c9f3f2891
commit 894c56014f
3 changed files with 11 additions and 7 deletions
+9
View File
@@ -0,0 +1,9 @@
'use strict';
module.exports = {
async count(ctx, next) {
const countArtiste = await strapi.entityService.count('api::artiste.artiste')
const countParole = await strapi.entityService.count('api::parole.parole')
return {countArtiste, countParole}
}
}
+12
View File
@@ -0,0 +1,12 @@
module.exports = {
routes: [
{
method: 'GET',
path: '/stats',
handler: 'stats.count',
config: {
auth: false,
}
}
]
}