web / lib/collections/sites/hooks
lib/collections/sites/hooks
Hooks for the Sites collection.
Provides lifecycle hooks for:
- Setting createdBy on creation
- Enforcing single default site
- Invalidating site cache on changes
- Auto-creating a default View when a Site is created
Variables
enforceSingleDefault
constenforceSingleDefault:CollectionBeforeChangeHook<Site>
Enforces that only one site can be the default. When a site is set as default, unsets any other default sites.
invalidateSiteCache
constinvalidateSiteCache:CollectionAfterChangeHook<Site>
Invalidates the site resolver cache after any site change.
createDefaultView
constcreateDefaultView:CollectionAfterChangeHook<Site>
Auto-creates a default View when a new Site is created. The View shows all data with auto-detected filters and default map settings.
References
setCreatedBy
Renames and re-exports setCreatedByHook
Last updated on