Checks whether queryParams.order is a function or string in the fix of sorting parameters

When the order queryParam parameter was a function the fix produced
incorrect query parameters.