fix: Filter drafts by default, related #6537

This commit is contained in:
Tom Moor
2024-02-24 16:39:54 -05:00
parent 168643c084
commit 0484941158

View File

@@ -391,6 +391,12 @@ export default class SearchHelper {
},
],
});
} else {
statusQuery.push({
publishedAt: {
[Op.ne]: null,
},
});
}
if (options.statusFilter?.includes(StatusFilter.Archived)) {
@@ -401,7 +407,7 @@ export default class SearchHelper {
});
}
if (options.statusFilter?.length) {
if (statusQuery.length) {
where[Op.and].push({
[Op.or]: statusQuery,
});