Custom Directus API hook to fire when published documents or visibility update
In continuation of #40 (closed), we need a way to isolate the cases in which a webhook is fired, in order to only rebuild the site when actually visible changes are made.
The current implementation just rebuilds the site on every change, which includes changes to collection items which have the status field set to draft or archived.
We only need to update for cases when:
- a published document
- is created
- is updated
- is deleted
Special conditions apply to the case that the status field is updated of any document, also unpublished ones.
- regenerate for changes that change visibility, excluding the cases draft ⯈ archived and archived ⯈ draft
- draft
- ⯈ published
- published
- ⯈ draft
- ⯈ archived
- archived
- ⯈ published
- draft
–
We need
-
an Action | Custom API Hooks | Directus Docs event that fires in the above cases
Edited by Jon Richter