As mentioned in the title,
Whenever you create a new item in a collection, it creates the item and then an activity (create) in the database. The hook item.create.[collection] works fine, but the one for item.create.directus_activity does not.
However, it works if you update an existing collection item.
Version 8.0.0-rc.2
@dannycoulombe - Are you trying to insert into directus_activity from your custom endpoint or are you looking to implementing the action for all the activities?
For all the activities.
I noted that if a collection had a status field, it works as expected (both hooks are called: collection + directus_activity). If not, only the collection action hook is called (even though an entry to directus_activity is created in the database).
@dannycoulombe - I tried to replicate the issue for collection with status as well as without status and the directus_activity hook is not triggered for any of them - which is obvious.
@rijkvanzanten - Current code doesn't have a feature to execute the hook for directus_activity as it's an individual function that inserts the data in table directly. Are we supposed to add this feature?
@bjgajjar Sorry, I might have caused this issue trying fix the core myself (status/no-status). However, the original issue is still present after reverting. I'll look deeper in it today and provide a pull request if I found the source of the problem.
@bjgajjar I think it makes sense to add. I would've expected it to work as well