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

Commit c630ef7

Browse files
authored
fix(isValidFindSlugParams): incorrect draftAndPublished check (#36)
Validation error should only trigger for content types that do NOT have draftAndPublish enabled.
1 parent b0aaa5d commit c630ef7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/utils/isValidFindSlugParams.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const isValidFindSlugParams = (params) => {
1717
throw new ValidationError('A slug path variable is required.');
1818
}
1919

20-
if (_.get(model, ['contentType', 'options', 'draftAndPublish'], false) && publicationState) {
20+
if (!_.get(model, ['contentType', 'options', 'draftAndPublish'], false) && publicationState) {
2121
throw new ValidationError('Filtering by publication state is only supported for content types that have Draft and Publish enabled.')
2222
}
2323

0 commit comments

Comments
 (0)