How to update single component in User?

I was finally able to solve it, maybe someone will find it useful.
First of all I wrote the updateUser method wrong. Here’s the correct one:

module.exports = {
  updateUser: async (id, data) => {
    return await strapi.query('user', 'users-permissions').update({ id }, {data});
  }
}

And then I called it wrong. Here’s how I do it now:

await strapi.services.user.updateUser(userId, {
  achievements: {
    id: ctx.state.user.achievements.id,
    hasCompletedFirstReview: true
  }
})
1 Like