counties, pagination, filter count, show total results
This commit is contained in:
15
bizmatch/src/app/services/criteria-change.service.ts
Normal file
15
bizmatch/src/app/services/criteria-change.service.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class CriteriaChangeService {
|
||||
private criteriaChangeSubject = new Subject<void>();
|
||||
|
||||
criteriaChange$ = this.criteriaChangeSubject.asObservable();
|
||||
|
||||
notifyCriteriaChange() {
|
||||
this.criteriaChangeSubject.next();
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { GeoResult } from '../../../../bizmatch-server/src/models/main.model';
|
||||
import { CountyResult, GeoResult } from '../../../../bizmatch-server/src/models/main.model';
|
||||
import { environment } from '../../environments/environment';
|
||||
|
||||
@Injectable({
|
||||
@@ -15,4 +15,7 @@ export class GeoService {
|
||||
const stateString = state ? `/${state}` : '';
|
||||
return this.http.get<GeoResult[]>(`${this.apiBaseUrl}/bizmatch/geo/${prefix}${stateString}`);
|
||||
}
|
||||
findCountiesStartingWith(prefix: string, states?: string[]): Observable<CountyResult[]> {
|
||||
return this.http.post<CountyResult[]>(`${this.apiBaseUrl}/bizmatch/geo/counties`, { prefix, states });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@ export class ListingsService {
|
||||
const result = await lastValueFrom(this.http.post<ResponseBusinessListingArray | ResponseCommercialPropertyListingArray>(`${this.apiBaseUrl}/bizmatch/listings/${listingsCategory}/find`, criteria));
|
||||
return result;
|
||||
}
|
||||
getNumberOfListings(criteria: BusinessListingCriteria | CommercialPropertyListingCriteria, listingsCategory: 'business' | 'commercialProperty'): Observable<number> {
|
||||
return this.http.post<number>(`${this.apiBaseUrl}/bizmatch/listings/${listingsCategory}/findTotal`, criteria);
|
||||
}
|
||||
async getListingsByPrompt(criteria: BusinessListingCriteria | CommercialPropertyListingCriteria): Promise<BusinessListing[]> {
|
||||
const result = await lastValueFrom(this.http.post<BusinessListing[]>(`${this.apiBaseUrl}/bizmatch/listings/business/search`, criteria));
|
||||
return result;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { lastValueFrom } from 'rxjs';
|
||||
import { lastValueFrom, Observable } from 'rxjs';
|
||||
import urlcat from 'urlcat';
|
||||
import { User } from '../../../../bizmatch-server/src/models/db.model';
|
||||
import { ResponseUsersArray, StatesResult, UserListingCriteria } from '../../../../bizmatch-server/src/models/main.model';
|
||||
@@ -30,6 +30,9 @@ export class UserService {
|
||||
async search(criteria?: UserListingCriteria): Promise<ResponseUsersArray> {
|
||||
return await lastValueFrom(this.http.post<ResponseUsersArray>(`${this.apiBaseUrl}/bizmatch/user/search`, criteria));
|
||||
}
|
||||
getNumberOfBroker(criteria?: UserListingCriteria): Observable<number> {
|
||||
return this.http.post<number>(`${this.apiBaseUrl}/bizmatch/user/findTotal`, criteria);
|
||||
}
|
||||
async getAllStates(): Promise<any> {
|
||||
return await lastValueFrom(this.http.get<StatesResult[]>(`${this.apiBaseUrl}/bizmatch/user/states/all`));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user