chore: removes ability to retain deleted versions
This commit is contained in:
@@ -126,7 +126,6 @@ const collectionSchema = joi.object().keys({
|
||||
versions: joi.alternatives().try(
|
||||
joi.object({
|
||||
maxPerDoc: joi.number(),
|
||||
retainDeleted: joi.boolean(),
|
||||
drafts: joi.alternatives().try(
|
||||
joi.object({
|
||||
autosave: joi.alternatives().try(
|
||||
|
||||
@@ -173,13 +173,11 @@ async function deleteOperation<TSlug extends keyof GeneratedTypes['collections']
|
||||
// Delete versions
|
||||
// /////////////////////////////////////
|
||||
|
||||
if (!collectionConfig.versions.retainDeleted) {
|
||||
deleteCollectionVersions({
|
||||
payload,
|
||||
id,
|
||||
slug: collectionConfig.slug,
|
||||
});
|
||||
}
|
||||
deleteCollectionVersions({
|
||||
payload,
|
||||
id,
|
||||
slug: collectionConfig.slug,
|
||||
});
|
||||
|
||||
// /////////////////////////////////////
|
||||
// afterDelete - Collection
|
||||
|
||||
@@ -6,7 +6,6 @@ export const versionCollectionDefaults: IncomingCollectionVersions = {
|
||||
interval: 2000, // in milliseconds
|
||||
},
|
||||
},
|
||||
retainDeleted: false,
|
||||
};
|
||||
|
||||
export const versionGlobalDefaults: IncomingGlobalVersions = {
|
||||
|
||||
@@ -12,22 +12,20 @@ export type SanitizedDrafts = {
|
||||
|
||||
export type IncomingCollectionVersions = {
|
||||
maxPerDoc?: number
|
||||
retainDeleted?: boolean
|
||||
drafts?: boolean | IncomingDrafts
|
||||
}
|
||||
|
||||
export interface SanitizedCollectionVersions extends Omit<IncomingCollectionVersions, 'drafts'> {
|
||||
maxPerDoc?: number
|
||||
retainDeleted: boolean
|
||||
drafts: SanitizedDrafts | false
|
||||
}
|
||||
|
||||
export type IncomingGlobalVersions= {
|
||||
export type IncomingGlobalVersions = {
|
||||
max?: number
|
||||
drafts?: boolean | IncomingDrafts
|
||||
}
|
||||
|
||||
export type SanitizedGlobalVersions= {
|
||||
export type SanitizedGlobalVersions = {
|
||||
max: number
|
||||
drafts: SanitizedDrafts | false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user