From bb58fb8a8a65815d3e91bfce3aa01e718c1fea3c Mon Sep 17 00:00:00 2001 From: Suren Date: Fri, 22 Sep 2023 17:39:40 +0530 Subject: [PATCH] #1551: Sort param serializer fix (#1552) (#1567) (cherry picked from commit 181ad4fa8b124bfe20df34fe642a74e1480158cf) --- geonode_mapstore_client/client/js/utils/APIUtils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/geonode_mapstore_client/client/js/utils/APIUtils.js b/geonode_mapstore_client/client/js/utils/APIUtils.js index d3bceb0316..e6f53154b2 100644 --- a/geonode_mapstore_client/client/js/utils/APIUtils.js +++ b/geonode_mapstore_client/client/js/utils/APIUtils.js @@ -114,10 +114,10 @@ export const getApiToken = () => { * @returns {Object} updated params */ export const paramsSerializer = (params) => { - const {include, exclude, ...rest} = params ?? {}; // Update bracket params (if any) + const {include, exclude, sort, ...rest} = params ?? {}; // Update bracket params (if any) let queryParams = ''; - if (!isEmpty(include) || !isEmpty(exclude)) { - queryParams = queryString.stringify({include, exclude}, { arrayFormat: 'bracket'}); + if (!isEmpty(include) || !isEmpty(exclude) || !isEmpty(sort)) { + queryParams = queryString.stringify({include, exclude, sort}, { arrayFormat: 'bracket'}); } if (!isEmpty(rest)) { queryParams = (isEmpty(queryParams) ? '' : `${queryParams}&`) + queryString.stringify(rest);