Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Commit 5ed1a48

Browse files
committed
fix: do not require useWorkflow or status
1 parent 7385990 commit 5ed1a48

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/middlewares/joi/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const allowedActions = [
2525

2626
const requiredString = Joi.string().required();
2727
const requiredNumber = Joi.number().required();
28-
const requiredBool = Joi.bool().required();
2928

3029
const collection = requiredString;
3130
const slug = requiredString;
@@ -137,8 +136,8 @@ export function defaultSchema({ path = requiredString } = {}) {
137136
options: Joi.object({
138137
collectionName: Joi.string(),
139138
commitMessage: requiredString,
140-
useWorkflow: requiredBool,
141-
status: requiredString,
139+
useWorkflow: Joi.bool(),
140+
status: Joi.string(),
142141
}).required(),
143142
})
144143
.xor('entry', 'dataFiles')

src/middlewares/localGit/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ export function localGitMiddleware({ repoPath, logger }: GitOptions) {
338338

339339
// add status for new entries
340340
if (!branchExists) {
341-
const description = statusToLabel(options.status, cmsLabelPrefix || '');
341+
const description = statusToLabel(options.status ?? 'draft', cmsLabelPrefix || '');
342342
await git.addConfig(branchDescription(cmsBranch), description);
343343
}
344344
});

src/middlewares/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export type PersistEntryParams = {
3333
options: {
3434
collectionName?: string;
3535
commitMessage: string;
36-
useWorkflow: boolean;
37-
status: string;
36+
useWorkflow?: boolean;
37+
status?: string;
3838
};
3939
};
4040

0 commit comments

Comments
 (0)