price optional, better labeling, impr. filter
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user