Take a look at the components section.
You should always specify the ID of the component that you want to update. Otherwise, it will be deleted and recreated. So the ID of the new component will change.
Is that a single component or a repeatable one?
In this example, you tried to update the User’s fields and not the component.
That example that you provided in the last post looks ok. It should work properly if your ctx.state.user.achievements.id exists.
await strapi.services.user.updateUser(userId, {
achievements:{
id: ctx.state.user.achievements.id,
hasCompletedFirstReview: true
}
});
Are you calling the strapi.services.user.updateUser service from the controller? Because services do not have access to the ctx object. Only you provide it to them. Can you try to output the ctx.state.user.achievements.id before calling the updateUser service?