System Information
- Strapi Version: 4.13.6
- Operating System: MacOS
- Database: Postgres
- Node Version: 18.18.0
- NPM Version: 9.8.1
- Yarn Version: 1.22.19
Does anyone know if there’s a way to determine from the event
object within the beforeUpdate
or beforeCreate
hook whether the update is coming from the Admin UI?
Looking at the object I can probably assume it’s the admin UI if the populate
object looks like this:
"populate": {
"channel_items": { "count": true },
"tax_rate": { "count": true },
"createdBy": true,
"updatedBy": true
},
However, this feels very flaky and subject to change to me.
(For context, I want to set an update_source
field on my model and I can do this manually for any API requests or a couple of queue workers I have in my project, but want to set it automatically when coming from the Admin UI rather than rely on users to set it.)