Skip to content

Commit

Permalink
fix: filter issue with chips on DocumentList
Browse files Browse the repository at this point in the history
  • Loading branch information
vhu-axelor committed Dec 4, 2024
1 parent b8bb514 commit cf56dce
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
30 changes: 25 additions & 5 deletions packages/apps/dms/src/api/document-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,31 @@ const createDocumentCriteria = ({
if (Array.isArray(extensions) && extensions.length > 0) {
criteria.push({
operator: 'or',
criteria: extensions.map(_extension => ({
fieldName: 'fileName',
operator: 'like',
value: '%.' + _extension,
})),
criteria: [
{
operator: 'and',
criteria: [
{
fieldName: 'isDirectory',
operator: '=',
value: false,
},
{
operator: 'or',
criteria: extensions.map(_extension => ({
fieldName: 'fileName',
operator: 'like',
value: '%.' + _extension,
})),
},
],
},
{
fieldName: 'isDirectory',
operator: '=',
value: true,
},
],
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ const DocumentList = ({defaultParent}: DocumentListProps) => {
const sliceFunctionData = useMemo(
() => ({
authorId: author?.id,
extensions: selectedExtensions.map(_extension => _extension.key),
}),
[author?.id, selectedExtensions],
[author?.id],
);

return (
Expand Down

0 comments on commit cf56dce

Please sign in to comment.