Skip to content

Commit

Permalink
Allow empty string filter value
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoshino committed Nov 15, 2024
1 parent 04b7bf4 commit 7f315a1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/lib/services/contents/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,8 @@ export const getEntriesByCollection = (collectionName) => {

const filterField = filter?.field;

const filterValues = filter?.value
? Array.isArray(filter.value)
? filter.value
: [filter.value]
: [];
const filterValues =
filter?.value === undefined ? [] : Array.isArray(filter.value) ? filter.value : [filter.value];

return get(allEntries).filter((entry) => {
if (!getCollectionsByEntry(entry).some(({ name }) => name === collectionName)) {
Expand Down

0 comments on commit 7f315a1

Please sign in to comment.