diff --git a/content/_partials/extension-hook-exceptions.md b/content/_partials/extension-hook-exceptions.md deleted file mode 100644 index 07b1c6d4..00000000 --- a/content/_partials/extension-hook-exceptions.md +++ /dev/null @@ -1,4 +0,0 @@ -::callout{icon="material-symbols:info-outline"} -**System Collection Exceptions** -The `collections` and `fields` system collections do not emit a `read` event. The `files` collection does not emit a `create` or `update` event on file upload. The `relations` collection does not emit a `delete` event. -:: diff --git a/content/_partials/extension-hook-system-collections.md b/content/_partials/extension-hook-system-collections.md new file mode 100644 index 00000000..0dac6ca6 --- /dev/null +++ b/content/_partials/extension-hook-system-collections.md @@ -0,0 +1,10 @@ +::callout{icon="material-symbols:info-outline"} +**System Collections** + +- `` should be replaced with the system collection name without the `directus_` prefix. For example, listening for new records in the `directus_users` collection becomes `users.create`. + +**Exceptions** + +- The `collections` and `fields` system collections do not emit a `read` event. The `files` collection does not emit a `create` or `update` event on file upload. The `relations` collection does not emit a `delete` event. + +:: diff --git a/content/guides/09.extensions/2.api-extensions/1.hooks.md b/content/guides/09.extensions/2.api-extensions/1.hooks.md index 7e08f999..c251f8fb 100644 --- a/content/guides/09.extensions/2.api-extensions/1.hooks.md +++ b/content/guides/09.extensions/2.api-extensions/1.hooks.md @@ -112,8 +112,6 @@ The context object has the following properties: [3] Available for the `oauth2`, and `openid` driver if set by provider. -:partial{content="extension-hook-exceptions"} - :partial{content="extension-hook-footguns"} ::callout{icon="material-symbols:warning-rounded" color="warning"} @@ -121,6 +119,8 @@ The context object has the following properties: Filters can impact performance if not implemented carefully, especially on `read` events, which can lead to many database reads. :: +:partial{content="extension-hook-system-collections"} + ## Action Action events are called after an event is emitted. @@ -183,10 +183,10 @@ The context object has the following properties: | `.update` | `payload`, `keys`, `collection` | | `.delete` | `keys`, `collection` | -:partial{content="extension-hook-exceptions"} - :partial{content="extension-hook-footguns"} +:partial{content="extension-hook-system-collections"} + ## Init Init events are called during the Directus application lifecycle.