Skip to content

Commit

Permalink
Allow entry filter to match undefined field
Browse files Browse the repository at this point in the history
Fix #274
  • Loading branch information
kyoshino committed Dec 12, 2024
1 parent 006eb1f commit 0582f62
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/services/contents/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export const getEntriesByCollection = (collectionName) => {
}

return filterValues.includes(
getPropertyValue({ entry, locale, collectionName, key: filterField }),
getPropertyValue({ entry, locale, collectionName, key: filterField }) ?? null,
);
});
};
Expand Down
3 changes: 2 additions & 1 deletion src/lib/typedefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,8 @@
* @property {string} [public_folder] - Public media folder path for an entry collection.
* @property {object} [filter] - Filter for an entry collection.
* @property {string} filter.field - Field name.
* @property {any | any[]} filter.value - Field value. Multiple values can be defined with an array.
* @property {any | any[]} filter.value - Field value. `null` can be used to match an undefined
* field. Multiple values can be defined with an array.
* @property {object} [nested] - Nested collection config for an entry collection.
* @property {boolean} [hide] - Whether to hide the collection in the UI.
* @property {boolean} [create] - Whether to allow creating items in an entry collection.
Expand Down

0 comments on commit 0582f62

Please sign in to comment.