@rolatech/angular-services 20.1.15 → 20.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2946,6 +2946,15 @@ class PropertySearchService extends BaseService {
|
|
|
2946
2946
|
const isEmpty = this.isEmptyFilter(params);
|
|
2947
2947
|
let httpParams = new HttpParams();
|
|
2948
2948
|
for (const [k, v] of Object.entries(params)) {
|
|
2949
|
+
if (k === 'sort' && v != null) {
|
|
2950
|
+
// Normalize sort for each backend
|
|
2951
|
+
const value = String(v);
|
|
2952
|
+
const sortForJpa = value; // e.g. "updatedAt desc"
|
|
2953
|
+
const sortForEs = value.replace(/\s+/, ','); // e.g. "updatedAt,desc"
|
|
2954
|
+
const finalSort = isEmpty ? sortForJpa : sortForEs;
|
|
2955
|
+
httpParams = httpParams.set('sort', finalSort);
|
|
2956
|
+
continue;
|
|
2957
|
+
}
|
|
2949
2958
|
if (Array.isArray(v)) {
|
|
2950
2959
|
v.forEach((item) => (httpParams = httpParams.append(k, String(item))));
|
|
2951
2960
|
}
|