Skip to content

Commit

Permalink
#1551: Sort param serializer fix (#1552)
Browse files Browse the repository at this point in the history
(cherry picked from commit 181ad4f)
  • Loading branch information
dsuren1 committed Sep 22, 2023
1 parent b3c9962 commit d6fd250
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions geonode_mapstore_client/client/js/utils/APIUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,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);
Expand Down

0 comments on commit d6fd250

Please sign in to comment.