Naming schema in strapi.services/strapi.models

I found the solution for my problem.

It was a notation error to get the right data:

const { sanitizeEntity } = require('strapi-utils');

module.exports = {

  async findOne (ctx) {
    const { slug } = ctx.params;

    const entity = await strapi.services['article-category'].findOne({ slug });
    return sanitizeEntity(entity, { model: strapi.models['article-category'] });
  },
};
1 Like