Need previous component data in lifecycle hook
Sem Limi
I need to get previous component data for a collection-type in lifecycle hook before the component data gets updated.
I tried getting the previous component data using 4 different methods in the beforeUpdate lifecycle hook, but in all 4 cases it returns me the updated component data rather than the previous component data before it gets updated. I listed the 4 methods I used and attached a screenshot of what I tried.
My collection-type is called tass and my component is called kickoutFlag just for some context.
Please can anyone tell me how I can get previous component data before it is updated in a lifecycle hook?
- strapi.requestContext.get();
- Using entityService api
- using strapi.query
- using strapi.db.query