chore: merge
This commit is contained in:
@@ -55,7 +55,7 @@ Configuring Versions is done by adding the `versions` key to your Collection con
|
||||
|
||||
| Option | Description |
|
||||
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `maxPerDoc` | Use this setting to control how many versions to keep on a document by document basis. Must be an integer. |
|
||||
| `maxPerDoc` | Use this setting to control how many versions to keep on a document by document basis. Must be an integer. Defaults to 100, use 0 to save all versions. |
|
||||
| `drafts ` | Enable [Drafts](/docs/versions/drafts) mode for this collection. To enable, set to `true` or pass an object with `draft` [options](/docs/versions/drafts#options). |
|
||||
|
||||
### Global config
|
||||
|
||||
@@ -94,12 +94,12 @@ export const saveVersion = async ({
|
||||
payload.logger.error(err);
|
||||
}
|
||||
|
||||
let max: number;
|
||||
let max = 100;
|
||||
|
||||
if (collection && typeof collection.versions.maxPerDoc === 'number') max = collection.versions.maxPerDoc;
|
||||
if (global && typeof global.versions.max === 'number') max = global.versions.max;
|
||||
|
||||
if (collection && collection.versions.maxPerDoc) {
|
||||
if (max > 0) {
|
||||
enforceMaxVersions({
|
||||
id,
|
||||
payload,
|
||||
|
||||
Reference in New Issue
Block a user