@rolatech/angular-services 20.2.9-beta.3 → 20.2.9-beta.4
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.
|
@@ -1715,21 +1715,10 @@ class PropertyService extends BaseService {
|
|
|
1715
1715
|
});
|
|
1716
1716
|
}
|
|
1717
1717
|
findUpcomingViewings(options) {
|
|
1718
|
-
return this.http
|
|
1719
|
-
.get(`${this.actionUrl}/viewings/upcoming`, {
|
|
1718
|
+
return this.http.get(`${this.actionUrl}/viewings/upcoming`, {
|
|
1720
1719
|
params: options,
|
|
1721
1720
|
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
|
-
}));
|
|
1721
|
+
});
|
|
1733
1722
|
}
|
|
1734
1723
|
findViewings(options) {
|
|
1735
1724
|
return this.http.get(`${this.actionUrl}/viewings`, {
|