Add count method to artiste & parole
This commit is contained in:
@@ -9,6 +9,11 @@ const getSlug = text => {
|
||||
}
|
||||
|
||||
module.exports = createCoreController('api::artiste.artiste', ({strapi}) => ({
|
||||
async count(ctx) {
|
||||
const {query} = ctx.request
|
||||
const result = await strapi.entityService.count('api::artiste.artiste', query)
|
||||
return result
|
||||
},
|
||||
async create(ctx) {
|
||||
const {body} = ctx.request
|
||||
let {data} = body
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
module.exports = {
|
||||
routes: [
|
||||
{
|
||||
method: 'GET',
|
||||
path: '/artiste/count',
|
||||
handler: 'artiste.count',
|
||||
config: {
|
||||
auth: false,
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user