Einbau klassische Filter als Overlay ...
This commit is contained in:
@@ -4,13 +4,13 @@ import { FormsModule } from '@angular/forms';
|
||||
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
||||
import onChange from 'on-change';
|
||||
import { BusinessListing, User } from '../../../../../../bizmatch-server/src/models/db.model';
|
||||
import { ListingCriteria, ListingType, emailToDirName } from '../../../../../../bizmatch-server/src/models/main.model';
|
||||
import { ListingType, UserListingCriteria, emailToDirName } from '../../../../../../bizmatch-server/src/models/main.model';
|
||||
import { environment } from '../../../../environments/environment';
|
||||
import { ImageService } from '../../../services/image.service';
|
||||
import { ListingsService } from '../../../services/listings.service';
|
||||
import { SelectOptionsService } from '../../../services/select-options.service';
|
||||
import { UserService } from '../../../services/user.service';
|
||||
import { getCriteriaStateObject, getSessionStorageHandler, resetCriteria } from '../../../utils/utils';
|
||||
import { getCriteriaStateObject, getSessionStorageHandler } from '../../../utils/utils';
|
||||
|
||||
@Component({
|
||||
selector: 'app-broker-listings',
|
||||
@@ -24,7 +24,7 @@ export class BrokerListingsComponent {
|
||||
listings: Array<BusinessListing>;
|
||||
users: Array<User>;
|
||||
filteredListings: Array<ListingType>;
|
||||
criteria: ListingCriteria;
|
||||
criteria: UserListingCriteria;
|
||||
realEstateChecked: boolean;
|
||||
maxPrice: string;
|
||||
minPrice: string;
|
||||
@@ -49,10 +49,9 @@ export class BrokerListingsComponent {
|
||||
private imageService: ImageService,
|
||||
private route: ActivatedRoute,
|
||||
) {
|
||||
this.criteria = onChange(getCriteriaStateObject(), getSessionStorageHandler);
|
||||
this.criteria = onChange(getCriteriaStateObject('user'), getSessionStorageHandler);
|
||||
this.route.data.subscribe(async () => {
|
||||
if (this.router.getCurrentNavigation().extras.state) {
|
||||
resetCriteria(this.criteria);
|
||||
} else {
|
||||
this.first = this.criteria.page * this.criteria.length;
|
||||
this.rows = this.criteria.length;
|
||||
@@ -86,7 +85,5 @@ export class BrokerListingsComponent {
|
||||
this.criteria.pageCount = event.pageCount;
|
||||
this.search();
|
||||
}
|
||||
reset() {
|
||||
this.criteria.name = '';
|
||||
}
|
||||
reset() {}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,12 @@ import { FormsModule } from '@angular/forms';
|
||||
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
||||
import onChange from 'on-change';
|
||||
import { BusinessListing } from '../../../../../../bizmatch-server/src/models/db.model';
|
||||
import { ListingCriteria, ListingType, emailToDirName } from '../../../../../../bizmatch-server/src/models/main.model';
|
||||
import { BusinessListingCriteria, ListingType, emailToDirName } from '../../../../../../bizmatch-server/src/models/main.model';
|
||||
import { environment } from '../../../../environments/environment';
|
||||
import { ImageService } from '../../../services/image.service';
|
||||
import { ListingsService } from '../../../services/listings.service';
|
||||
import { SelectOptionsService } from '../../../services/select-options.service';
|
||||
import { getCriteriaStateObject, getSessionStorageHandler, resetCriteria } from '../../../utils/utils';
|
||||
import { getCriteriaStateObject, getSessionStorageHandler } from '../../../utils/utils';
|
||||
|
||||
@Component({
|
||||
selector: 'app-business-listings',
|
||||
@@ -22,7 +22,7 @@ export class BusinessListingsComponent {
|
||||
environment = environment;
|
||||
listings: Array<BusinessListing>;
|
||||
filteredListings: Array<BusinessListing>;
|
||||
criteria: ListingCriteria;
|
||||
criteria: BusinessListingCriteria;
|
||||
realEstateChecked: boolean;
|
||||
maxPrice: string;
|
||||
minPrice: string;
|
||||
@@ -45,10 +45,9 @@ export class BusinessListingsComponent {
|
||||
private imageService: ImageService,
|
||||
private route: ActivatedRoute,
|
||||
) {
|
||||
this.criteria = onChange(getCriteriaStateObject(), getSessionStorageHandler);
|
||||
this.criteria = onChange(getCriteriaStateObject('business'), getSessionStorageHandler);
|
||||
this.route.data.subscribe(async () => {
|
||||
if (this.router.getCurrentNavigation().extras.state) {
|
||||
resetCriteria(this.criteria);
|
||||
} else {
|
||||
this.first = this.criteria.page * this.criteria.length;
|
||||
this.rows = this.criteria.length;
|
||||
@@ -70,12 +69,12 @@ export class BusinessListingsComponent {
|
||||
this.search();
|
||||
}
|
||||
async search() {
|
||||
this.listings = await this.listingsService.getListingsByPrompt(this.criteria);
|
||||
// const listingReponse = await this.listingsService.getListings(this.criteria, 'business');
|
||||
// this.listings = listingReponse.data;
|
||||
// this.totalRecords = listingReponse.total;
|
||||
// this.cdRef.markForCheck();
|
||||
// this.cdRef.detectChanges();
|
||||
//this.listings = await this.listingsService.getListingsByPrompt(this.criteria);
|
||||
const listingReponse = await this.listingsService.getListings(this.criteria, 'business');
|
||||
this.listings = listingReponse.data;
|
||||
this.totalRecords = listingReponse.total;
|
||||
this.cdRef.markForCheck();
|
||||
this.cdRef.detectChanges();
|
||||
}
|
||||
onPageChange(event: any) {
|
||||
this.criteria.start = event.first;
|
||||
|
||||
@@ -4,12 +4,12 @@ import { FormsModule } from '@angular/forms';
|
||||
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
||||
import onChange from 'on-change';
|
||||
import { CommercialPropertyListing } from '../../../../../../bizmatch-server/src/models/db.model';
|
||||
import { ListingCriteria } from '../../../../../../bizmatch-server/src/models/main.model';
|
||||
import { CommercialPropertyListingCriteria } from '../../../../../../bizmatch-server/src/models/main.model';
|
||||
import { environment } from '../../../../environments/environment';
|
||||
import { ImageService } from '../../../services/image.service';
|
||||
import { ListingsService } from '../../../services/listings.service';
|
||||
import { SelectOptionsService } from '../../../services/select-options.service';
|
||||
import { getCriteriaStateObject, getSessionStorageHandler, resetCriteria } from '../../../utils/utils';
|
||||
import { getCriteriaStateObject, getSessionStorageHandler } from '../../../utils/utils';
|
||||
|
||||
@Component({
|
||||
selector: 'app-commercial-property-listings',
|
||||
@@ -22,7 +22,7 @@ export class CommercialPropertyListingsComponent {
|
||||
environment = environment;
|
||||
listings: Array<CommercialPropertyListing>;
|
||||
filteredListings: Array<CommercialPropertyListing>;
|
||||
criteria: ListingCriteria;
|
||||
criteria: CommercialPropertyListingCriteria;
|
||||
realEstateChecked: boolean;
|
||||
first: number = 0;
|
||||
rows: number = 12;
|
||||
@@ -44,10 +44,9 @@ export class CommercialPropertyListingsComponent {
|
||||
private imageService: ImageService,
|
||||
private route: ActivatedRoute,
|
||||
) {
|
||||
this.criteria = onChange(getCriteriaStateObject(), getSessionStorageHandler);
|
||||
this.criteria = onChange(getCriteriaStateObject('commercialProperty'), getSessionStorageHandler);
|
||||
this.route.data.subscribe(async () => {
|
||||
if (this.router.getCurrentNavigation().extras.state) {
|
||||
resetCriteria(this.criteria);
|
||||
} else {
|
||||
this.first = this.criteria.page * this.criteria.length;
|
||||
this.rows = this.criteria.length;
|
||||
|
||||
Reference in New Issue
Block a user