@rolatech/angular-services 20.2.4-beta.1 → 20.2.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.
|
@@ -1731,39 +1731,23 @@ class PropertyService extends BaseService {
|
|
|
1731
1731
|
}));
|
|
1732
1732
|
}));
|
|
1733
1733
|
}
|
|
1734
|
+
findViewings(options) {
|
|
1735
|
+
return this.http.get(`${this.actionUrl}/viewings`, {
|
|
1736
|
+
params: options,
|
|
1737
|
+
withCredentials: true,
|
|
1738
|
+
});
|
|
1739
|
+
}
|
|
1734
1740
|
findViewingsByUser(options) {
|
|
1735
|
-
return this.http
|
|
1736
|
-
.get(`${this.actionUrl}/viewings/by/user`, {
|
|
1741
|
+
return this.http.get(`${this.actionUrl}/viewings/by/user`, {
|
|
1737
1742
|
params: options,
|
|
1738
1743
|
withCredentials: true,
|
|
1739
|
-
})
|
|
1740
|
-
.pipe(switchMap((res) => {
|
|
1741
|
-
const propertyIds = _.uniq(_.map(res.data, 'propertyId')); // [12, 14, 16, 18]
|
|
1742
|
-
return this.findPropertiesByIds(propertyIds).pipe(map((properties) => {
|
|
1743
|
-
res.data?.forEach((item) => {
|
|
1744
|
-
const matchingProperty = _.find(properties.data, { id: item.propertyId });
|
|
1745
|
-
item.property = matchingProperty;
|
|
1746
|
-
});
|
|
1747
|
-
return res;
|
|
1748
|
-
}));
|
|
1749
|
-
}));
|
|
1744
|
+
});
|
|
1750
1745
|
}
|
|
1751
1746
|
findViewingsByAgent(options) {
|
|
1752
|
-
return this.http
|
|
1753
|
-
.get(`${this.actionUrl}/viewings/by/agent`, {
|
|
1747
|
+
return this.http.get(`${this.actionUrl}/viewings/by/agent`, {
|
|
1754
1748
|
params: options,
|
|
1755
1749
|
withCredentials: true,
|
|
1756
|
-
})
|
|
1757
|
-
.pipe(switchMap((res) => {
|
|
1758
|
-
const propertyIds = _.uniq(_.map(res.data, 'propertyId')); // [12, 14, 16, 18]
|
|
1759
|
-
return this.findPropertiesByIds(propertyIds).pipe(map((properties) => {
|
|
1760
|
-
res.data?.forEach((item) => {
|
|
1761
|
-
const matchingProperty = _.find(properties.data, { id: item.propertyId });
|
|
1762
|
-
item.property = matchingProperty;
|
|
1763
|
-
});
|
|
1764
|
-
return res;
|
|
1765
|
-
}));
|
|
1766
|
-
}));
|
|
1750
|
+
});
|
|
1767
1751
|
}
|
|
1768
1752
|
requestViewing(propertyId, data) {
|
|
1769
1753
|
return this.http.post(`${this.actionUrl}/${propertyId}/viewings`, data, {
|