Replace 'stats' from artiste to new controller 'stats'
This commit is contained in:
@@ -9,11 +9,6 @@ const getSlug = text => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.exports = createCoreController('api::artiste.artiste', ({strapi}) => ({
|
module.exports = createCoreController('api::artiste.artiste', ({strapi}) => ({
|
||||||
async count(ctx) {
|
|
||||||
const countArtiste = await strapi.entityService.count('api::artiste.artiste')
|
|
||||||
const countParole = await strapi.entityService.count('api::parole.parole')
|
|
||||||
return {countArtiste, countParole}
|
|
||||||
},
|
|
||||||
async create(ctx) {
|
async create(ctx) {
|
||||||
const {body} = ctx.request
|
const {body} = ctx.request
|
||||||
let {data} = body
|
let {data} = body
|
||||||
|
|||||||
@@ -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}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,10 +3,10 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
path: '/stats',
|
path: '/stats',
|
||||||
handler: 'artiste.count',
|
handler: 'stats.count',
|
||||||
config: {
|
config: {
|
||||||
auth: false,
|
auth: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user