feat: add publish configuration option to collections (#3467)
This commit is contained in:
@ -152,5 +152,17 @@ describe('config', () => {
|
||||
);
|
||||
}).not.toThrowError();
|
||||
});
|
||||
|
||||
it('should throw if collection publish is not a boolean', () => {
|
||||
expect(() => {
|
||||
validateConfig(merge(validConfig, { collections: [{ publish: 'false' }] }));
|
||||
}).toThrowError("'collections[0].publish' should be boolean");
|
||||
});
|
||||
|
||||
it('should not throw if collection publish is a boolean', () => {
|
||||
expect(() => {
|
||||
validateConfig(merge(validConfig, { collections: [{ publish: false }] }));
|
||||
}).not.toThrowError();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -117,6 +117,7 @@ const getConfigSchema = () => ({
|
||||
preview_path: { type: 'string' },
|
||||
preview_path_date_field: { type: 'string' },
|
||||
create: { type: 'boolean' },
|
||||
publish: { type: 'boolean' },
|
||||
editor: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
|
Reference in New Issue
Block a user