16 lines
705 B
TypeScript
16 lines
705 B
TypeScript
import type { CollectionBeforeDeleteHook } from 'payload';
|
|
/**
|
|
* Blocks deletion of a page assigned a System Page role (homepage,
|
|
* privacyPolicy, cookiePolicy, termsOfService). An editor deleting the privacy
|
|
* policy or homepage by accident would break routing and compliance links; this
|
|
* stops it with a clear error. They must unassign the role first (deliberate).
|
|
*
|
|
* Reads the role assignments from SiteSettings (which page holds which role).
|
|
*
|
|
* hooks: { beforeDelete: [buildPreventDeleteSystemPage({ settingsSlug: 'site-settings' })] }
|
|
*/
|
|
export declare function buildPreventDeleteSystemPage(args?: {
|
|
roleFields?: string[];
|
|
settingsSlug?: string;
|
|
}): CollectionBeforeDeleteHook;
|