From 40557ccedc433b0a8494ddc52e4bc9d03b9f1c15 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Fri, 19 Mar 2021 22:16:47 +0300 Subject: [PATCH] Web: Files: fixed filter --- packages/asc-web-common/api/files/filter.js | 23 +++++++++++---------- packages/asc-web-common/utils/index.js | 6 +++++- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/packages/asc-web-common/api/files/filter.js b/packages/asc-web-common/api/files/filter.js index 80edbeb969..217f335e97 100644 --- a/packages/asc-web-common/api/files/filter.js +++ b/packages/asc-web-common/api/files/filter.js @@ -76,14 +76,15 @@ class FilesFilter { withSubfolders, } = this; - const isFilterSet = - filterType || (search ?? "").trim() || authorType - ? withSubfolders - : false; - const userIdOrGroupId = - authorType && authorType.includes("_") - ? authorType.slice(authorType.indexOf("_") + 1) - : null; + // const isFilterSet = + // filterType || (search ?? "").trim() || authorType + // ? withSubfolders + // : false; + + // const userIdOrGroupId = + // authorType && authorType.includes("_") + // ? authorType.slice(authorType.indexOf("_") + 1) + // : null; const dtoFilter = { folder, @@ -92,9 +93,9 @@ class FilesFilter { sortby: sortBy, sortOrder: sortOrder, filterType: filterType, - filterValue: (search ?? "").trim(), - withSubfolders: isFilterSet, - userIdOrGroupId, + search: (search ?? "").trim(), + withSubfolders, + authorType, }; if (pageCount !== DEFAULT_PAGE) { diff --git a/packages/asc-web-common/utils/index.js b/packages/asc-web-common/utils/index.js index 397c38332f..b611916de5 100644 --- a/packages/asc-web-common/utils/index.js +++ b/packages/asc-web-common/utils/index.js @@ -6,7 +6,11 @@ import TopLoaderService from "@appserver/components/top-loading-indicator"; export const toUrlParams = (obj, skipNull) => { let str = ""; for (var key in obj) { - if (skipNull && !obj[key]) continue; + if ( + (skipNull && !obj[key] && key !== "withSubfolders") || + (key === "withSubfolders" && obj[key] !== "false") + ) + continue; if (str !== "") { str += "&";