diff --git a/packages/apps/dms/src/api/document-api.js b/packages/apps/dms/src/api/document-api.js index 38fd27d68..e2c440ef9 100644 --- a/packages/apps/dms/src/api/document-api.js +++ b/packages/apps/dms/src/api/document-api.js @@ -43,11 +43,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, + }, + ], }); }