I made a notification component to my Users collection, and I want to create an automatic notification system during some events.
One of them is adding document to the User collection from the admin in the back-office.
To do this, i try to get this information in the beforeUpdate lifecycle of the user model, but Strapi sends all the user’s datas, not just the modified one…
Someone has an idea how to do this in a simple way.
Today, i just see two solutions: get the actual user data in the hooks and compare them, or create a plugin to upload document to the user and create a notification in the same way. But both are heavy solutions…
Error after registering new user: TypeError: Cannot read property 'toggle' of undefined
at Object.afterCreate (/srv/app/extensions/users-permissions/models/User.js:13:36)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async executeLifecycle (/srv/app/node_modules/strapi-database/lib/utils/lifecycles.js:11:5)
at async Object.create (/srv/app/node_modules/strapi-database/lib/queries/helpers.js:18:3)
at async Object.register (/srv/app/node_modules/strapi-plugin-users-permissions/controllers/Auth.js:492:20)
at async resolver (/srv/app/node_modules/strapi-plugin-users-permissions/config/schema.graphql.js:195:11)