View counter in strapi: With lifecycle hooks? But how to use them?

Hello @DMehaffy :wave:

I was looking to implement the same functionality and I end up doing this way:

async afterFindOne(result, params, populate) {
      if (result) {
        strapi
          .query("past-shows")
          .update({ id: result.id }, { views: parseInt(result.views) + 1 });
      }
    },

However, the value only increases if I access the article in the Strapi Admin, if I access the API URL it not increase. What am I doing wrong? :thinking:

Thank you!