location eingebaut, back buttons angeglichen, paging & criteria korrigiert
This commit is contained in:
@@ -49,10 +49,10 @@ export class BusinessListingsComponent {
|
||||
private route: ActivatedRoute,
|
||||
private searchService: SearchService,
|
||||
) {
|
||||
this.criteria = getCriteriaStateObject('business');
|
||||
this.criteria = getCriteriaStateObject('businessListings');
|
||||
this.init();
|
||||
this.searchService.currentCriteria.subscribe(criteria => {
|
||||
if (criteria && criteria.criteriaType === 'business') {
|
||||
if (criteria && criteria.criteriaType === 'businessListings') {
|
||||
this.criteria = criteria as BusinessListingCriteria;
|
||||
this.search();
|
||||
}
|
||||
@@ -66,11 +66,11 @@ export class BusinessListingsComponent {
|
||||
}
|
||||
|
||||
async search() {
|
||||
//this.listings = await this.listingsService.getListingsByPrompt(this.criteria);
|
||||
const listingReponse = await this.listingsService.getListings(this.criteria, 'business');
|
||||
this.listings = listingReponse.results;
|
||||
this.totalRecords = listingReponse.totalCount;
|
||||
this.pageCount = this.totalRecords % LISTINGS_PER_PAGE === 0 ? this.totalRecords / LISTINGS_PER_PAGE : Math.floor(this.totalRecords / LISTINGS_PER_PAGE) + 1;
|
||||
this.page = this.criteria.page ? this.criteria.page : 1;
|
||||
this.cdRef.markForCheck();
|
||||
this.cdRef.detectChanges();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user