Überarbeitung

This commit is contained in:
2024-08-09 17:59:49 +02:00
parent 6d1c50d5df
commit 1e1d5cea57
27 changed files with 135 additions and 112 deletions

View File

@@ -64,6 +64,7 @@ export class HomeComponent {
}
async changeTab(tabname: 'business' | 'commercialProperty' | 'broker') {
this.activeTabAction = tabname;
this.cityOrState = null;
if ('business' === tabname) {
this.criteria = createEnhancedProxy(getCriteriaStateObject('businessListings'), this);
} else if ('commercialProperty' === tabname) {
@@ -74,22 +75,7 @@ export class HomeComponent {
this.criteria = undefined;
}
}
// private createEnhancedProxy(obj: any) {
// const component = this;
// const sessionStorageHandler = function (path, value, previous, applyData) {
// let criteriaType = this.criteriaType;
// sessionStorage.setItem(`${criteriaType}_criteria`, JSON.stringify(this));
// };
// return onChange(obj, function (path, value, previous, applyData) {
// // Call the original sessionStorageHandler
// sessionStorageHandler.call(this, path, value, previous, applyData);
// // Notify about the criteria change using the component's context
// component.criteriaChangeService.notifyCriteriaChange();
// });
// }
search() {
this.router.navigate([`${this.activeTabAction}Listings`]);
}
@@ -126,7 +112,6 @@ export class HomeComponent {
async openModal() {
const accepted = await this.modalService.showModal(this.criteria);
if (accepted) {
//this.searchService.search(this.criteria);
this.router.navigate([`${this.activeTabAction}Listings`]);
}
}
@@ -153,10 +138,10 @@ export class HomeComponent {
setCityOrState(cityOrState: CityAndStateResult) {
if (cityOrState) {
if (cityOrState.type === 'state') {
this.criteria.state = cityOrState.state;
this.criteria.state = cityOrState.content.state_code;
} else {
this.criteria.city = cityOrState.name;
this.criteria.state = cityOrState.state;
this.criteria.city = cityOrState.content as GeoResult;
this.criteria.state = cityOrState.content.state;
this.criteria.searchType = 'radius';
this.criteria.radius = 20;
}