From 25f26e24ccfe57609415e7819376e57c9e71bd46 Mon Sep 17 00:00:00 2001 From: vhu-axelor <146069039+vhu-axelor@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:03:38 +0100 Subject: [PATCH] fix: filter issue with chips on DocumentList (#827) * RM#87963 --- packages/apps/dms/src/api/document-api.js | 30 +++++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/packages/apps/dms/src/api/document-api.js b/packages/apps/dms/src/api/document-api.js index 38fd27d68c..e2c440ef91 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, + }, + ], }); }