@rolatech/angular-services 20.2.9-beta.3 → 20.2.9-beta.5
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.
|
@@ -1529,6 +1529,12 @@ class PropertyService extends BaseService {
|
|
|
1529
1529
|
withCredentials: true,
|
|
1530
1530
|
});
|
|
1531
1531
|
}
|
|
1532
|
+
byAgent(options) {
|
|
1533
|
+
return this.http.get(`${this.actionUrl}/by/agent`, {
|
|
1534
|
+
params: options,
|
|
1535
|
+
withCredentials: true,
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1532
1538
|
findByIds(ids) {
|
|
1533
1539
|
const params = { ids: ids.join(',') };
|
|
1534
1540
|
return this.http.get(`${this.actionUrl}/by`, {
|
|
@@ -1714,22 +1720,12 @@ class PropertyService extends BaseService {
|
|
|
1714
1720
|
withCredentials: true,
|
|
1715
1721
|
});
|
|
1716
1722
|
}
|
|
1723
|
+
// viewings
|
|
1717
1724
|
findUpcomingViewings(options) {
|
|
1718
|
-
return this.http
|
|
1719
|
-
.get(`${this.actionUrl}/viewings/upcoming`, {
|
|
1725
|
+
return this.http.get(`${this.actionUrl}/viewings/upcoming`, {
|
|
1720
1726
|
params: options,
|
|
1721
1727
|
withCredentials: true,
|
|
1722
|
-
})
|
|
1723
|
-
.pipe(switchMap((res) => {
|
|
1724
|
-
const propertyIds = _.uniq(_.map(res.data, 'propertyId')); // [12, 14, 16, 18]
|
|
1725
|
-
return this.findPropertiesByIds(propertyIds).pipe(map((properties) => {
|
|
1726
|
-
res.data?.forEach((item) => {
|
|
1727
|
-
const matchingProperty = _.find(properties.data, { id: item.propertyId });
|
|
1728
|
-
item.propertyTitle = matchingProperty ? matchingProperty.title : 'Unknown property'; // fallback
|
|
1729
|
-
});
|
|
1730
|
-
return res;
|
|
1731
|
-
}));
|
|
1732
|
-
}));
|
|
1728
|
+
});
|
|
1733
1729
|
}
|
|
1734
1730
|
findViewings(options) {
|
|
1735
1731
|
return this.http.get(`${this.actionUrl}/viewings`, {
|
|
@@ -2928,11 +2924,6 @@ class PropertySearchService extends BaseService {
|
|
|
2928
2924
|
this.endpoint = 'properties';
|
|
2929
2925
|
super.init();
|
|
2930
2926
|
}
|
|
2931
|
-
search1(options) {
|
|
2932
|
-
return this.http.get(`${this.actionUrl}/search`, {
|
|
2933
|
-
params: options,
|
|
2934
|
-
});
|
|
2935
|
-
}
|
|
2936
2927
|
search(rawParams) {
|
|
2937
2928
|
const params = this.stripUndefined(rawParams);
|
|
2938
2929
|
// Decide route: empty filter → DB list; else → Elasticsearch-backed search
|