diff --git a/packages/apps/dms/src/api/document-api.js b/packages/apps/dms/src/api/document-api.js index a5331bccb..40d1cefa8 100644 --- a/packages/apps/dms/src/api/document-api.js +++ b/packages/apps/dms/src/api/document-api.js @@ -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, + }, + ], }); } diff --git a/packages/apps/dms/src/components/templates/DocumentList/DocumentList.tsx b/packages/apps/dms/src/components/templates/DocumentList/DocumentList.tsx index ccad7e3b8..4c998e1ca 100644 --- a/packages/apps/dms/src/components/templates/DocumentList/DocumentList.tsx +++ b/packages/apps/dms/src/components/templates/DocumentList/DocumentList.tsx @@ -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 (