How to Prevent updatedAt from Changing on Specific PUT API Calls in Strapi

I found a way by creating lifecycles.js :

module.exports = {
  async beforeUpdate(event) {
    const { data, where } = event.params;
    if (data.viewCount !== undefined) {
      const entry = await strapi.entityService.findOne('api::game.game', where.id, { fields: ['updatedAt'] });
      data.updatedAt = entry.updatedAt;
    }
  },
};