diff --git a/bizmatch/src/app/components/search-modal/search-modal.component.html b/bizmatch/src/app/components/search-modal/search-modal.component.html
index 1332ffc..cec1fb2 100644
--- a/bizmatch/src/app/components/search-modal/search-modal.component.html
+++ b/bizmatch/src/app/components/search-modal/search-modal.component.html
@@ -1,15 +1,15 @@
-
+
@if(criteria.criteriaType==='businessListings') {
-
Business Listing Search
+
Business Listing Search
} @else if (criteria.criteriaType==='commercialPropertyListings') {
Property Listing Search
} @else {
Professional Listing Search
}
-
-
-
-
-
-
-
-
-
-
-
-
-
- @for (radius of [5, 20, 50, 100, 200, 300, 400, 500]; track radius) {
-
- {{ radius }}
-
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
State: {{ criteria.state }} ×
@@ -222,19 +58,161 @@
Broker: {{ criteria.brokerName }} ×
-
-
-
-
- Search ({{ numberOfResults$ | async }})
-
-
- Cancel
-
+
+
+
+
+
+
+
+
+
+
+
+ @for (radius of [5, 20, 50, 100, 200, 300, 400, 500]; track radius) {
+
+ {{ radius }}
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bizmatch/src/app/components/search-modal/search-modal.component.ts b/bizmatch/src/app/components/search-modal/search-modal.component.ts
index d421da1..b8c4bb8 100644
--- a/bizmatch/src/app/components/search-modal/search-modal.component.ts
+++ b/bizmatch/src/app/components/search-modal/search-modal.component.ts
@@ -73,6 +73,7 @@ export class SearchModalComponent {
// this.loadCities();
this.loadCounties();
this.updateSelectedPropertyType();
+ this.modalService.sendCriteria(this.criteria);
}
hasActiveFilters(): boolean {
return !!(
@@ -241,6 +242,11 @@ export class SearchModalComponent {
closeModal() {
console.log('Closing modal');
}
+ closeAndSearch() {
+ this.modalService.accept();
+ this.searchService.search(this.criteria);
+ this.close();
+ }
isTypeOfBusinessClicked(v: KeyValueStyle) {
return this.criteria.types.find(t => t === v.value);
}
diff --git a/bizmatch/src/app/pages/listings/business-listings/business-listings.component.ts b/bizmatch/src/app/pages/listings/business-listings/business-listings.component.ts
index dc12c90..0a740b9 100644
--- a/bizmatch/src/app/pages/listings/business-listings/business-listings.component.ts
+++ b/bizmatch/src/app/pages/listings/business-listings/business-listings.component.ts
@@ -113,9 +113,8 @@ export class BusinessListingsComponent {
// Open the search modal with current criteria
const modalResult = await this.modalService.showModal(this.criteria);
if (modalResult.accepted) {
- this.searchService.search(this.criteria);
- } else {
- this.criteria = assignProperties(this.criteria, modalResult.criteria);
+ this.criteria = assignProperties(this.criteria, modalResult.criteria); // Update criteria with modal result
+ this.searchService.search(this.criteria); // Trigger search with updated criteria
}
}
}