System Information
- Strapi Version: 4.0.6
I have added an ‘achievements’ component to the User model. Basically it’s a component with a bunch of boolean fields, each is initiated as false by default.
In v3 I was able to customize a controller, for example lets call it test
, override the create
method and do something like that when I sent a POST request to http://localhost:1337/api/test
:
//...some logic here
await strapi.services.user.updateUser(userId, {
achievements: {
id: ctx.state.user.achievements.id,
hasCompletedFirstAssignment: true
}
})
However for some reason it doesn’t work in v4. Upon inspection I don’t see the achievements
property in ctx.state.user
. Why is that so? Is there any way to make it present there? Or any other way to update that component?