Adds custom.retention (monthly purge, 90-day post-deletion hard-delete) to the media Payload collection. No uploadedBy field exists in the collection so no custom.pii annotation is needed.
29 lines
506 B
TypeScript
29 lines
506 B
TypeScript
import type { CollectionConfig } from "payload";
|
|
|
|
export const media: CollectionConfig = {
|
|
slug: "media",
|
|
custom: {
|
|
retention: {
|
|
purgeSchedule: "monthly",
|
|
postDeletion: {
|
|
duration: "P90D",
|
|
trigger: "after-deletion",
|
|
action: "hard-delete",
|
|
},
|
|
},
|
|
},
|
|
upload: {
|
|
mimeTypes: ["image/*", "application/pdf"],
|
|
},
|
|
admin: {
|
|
useAsTitle: "filename",
|
|
},
|
|
fields: [
|
|
{
|
|
name: "alt",
|
|
type: "text",
|
|
required: true,
|
|
},
|
|
],
|
|
};
|