price optional, better labeling, impr. filter

This commit is contained in:
2025-09-29 14:44:47 -05:00
parent 03d075b7d9
commit fbca2ddab5
7 changed files with 98 additions and 79 deletions

View File

@@ -86,14 +86,12 @@ export class SearchModalComponent implements OnInit, OnDestroy {
}
// Setup debounced search
this.searchDebounce$.pipe(debounceTime(400), distinctUntilChanged(), takeUntil(this.destroy$)).subscribe(() => {
this.triggerSearch();
});
this.searchDebounce$.pipe(debounceTime(400), takeUntil(this.destroy$)).subscribe(() => this.triggerSearch());
}
private initializeWithCriteria(criteria: any): void {
this.criteria = criteria;
this.currentListingType = criteria.criteriaType;
this.currentListingType = criteria?.criteriaType;
this.backupCriteria = JSON.parse(JSON.stringify(criteria));
this.updateSelectedPropertyType();
this.setTotalNumberOfResults();
@@ -312,7 +310,7 @@ export class SearchModalComponent implements OnInit, OnDestroy {
}
// Helper methods
private updateCriteria(updates: any): void {
public updateCriteria(updates: any): void {
if (this.isModal) {
// In modal: Update locally only
this.criteria = { ...this.criteria, ...updates };
@@ -356,10 +354,10 @@ export class SearchModalComponent implements OnInit, OnDestroy {
switch (this.currentListingType) {
case 'businessListings':
this.numberOfResults$ = this.listingService.getNumberOfListings('business');
this.numberOfResults$ = this.listingService.getNumberOfListings('business', this.criteria);
break;
case 'commercialPropertyListings':
this.numberOfResults$ = this.listingService.getNumberOfListings('commercialProperty');
this.numberOfResults$ = this.listingService.getNumberOfListings('commercialProperty', this.criteria);
break;
case 'brokerListings':
this.numberOfResults$ = this.userService.getNumberOfBroker();