System Information
- Strapi Version: 4.5.1
hey i would like to create a custom route, to make a count. I created the route, it appears in the permissions. I applied the permissions. but celecie sends me back a 404.
module.exports = {
routes: [
{
method: 'GET',
path: '/artworks/count',
handler: 'artwork.count',
},
]
}
'use strict';
/**
* artwork controller
*/
const { createCoreController } = require('@strapi/strapi').factories;
const moduleUid = 'api::artwork.artwork'
module.exports = createCoreController(moduleUid, {
count(ctx) {
console.log(ctx)
var { query } = ctx.request
return strapi.query(moduleUid).count({ where: query });
}
});
thank you for your help =)