Bug Fixing overall
This commit is contained in:
@@ -6,6 +6,7 @@ import onChange from 'on-change';
|
||||
import { ButtonModule } from 'primeng/button';
|
||||
import { CheckboxModule } from 'primeng/checkbox';
|
||||
import { DropdownModule } from 'primeng/dropdown';
|
||||
import { InputGroupModule } from 'primeng/inputgroup';
|
||||
import { InputTextModule } from 'primeng/inputtext';
|
||||
import { PaginatorModule } from 'primeng/paginator';
|
||||
import { StyleClassModule } from 'primeng/styleclass';
|
||||
@@ -22,7 +23,7 @@ import { createGenericObject, getCriteriaStateObject, getSessionStorageHandler }
|
||||
@Component({
|
||||
selector: 'app-broker-listings',
|
||||
standalone: true,
|
||||
imports: [CommonModule, StyleClassModule, ButtonModule, CheckboxModule, InputTextModule, DropdownModule, FormsModule, StyleClassModule, ToggleButtonModule, RouterModule, PaginatorModule],
|
||||
imports: [CommonModule, StyleClassModule, ButtonModule, CheckboxModule, InputTextModule, DropdownModule, FormsModule, StyleClassModule, ToggleButtonModule, RouterModule, PaginatorModule, InputGroupModule],
|
||||
templateUrl: './broker-listings.component.html',
|
||||
styleUrl: './broker-listings.component.scss',
|
||||
})
|
||||
@@ -33,7 +34,6 @@ export class BrokerListingsComponent {
|
||||
filteredListings: Array<ListingType>;
|
||||
criteria: ListingCriteria;
|
||||
realEstateChecked: boolean;
|
||||
// category: string;
|
||||
maxPrice: string;
|
||||
minPrice: string;
|
||||
type: string;
|
||||
@@ -56,12 +56,12 @@ export class BrokerListingsComponent {
|
||||
private imageService: ImageService,
|
||||
) {
|
||||
this.criteria = onChange(getCriteriaStateObject(), getSessionStorageHandler);
|
||||
this.criteria.type = undefined;
|
||||
this.router.getCurrentNavigation();
|
||||
this.activatedRoute.snapshot;
|
||||
this.activatedRoute.params.subscribe(params => {
|
||||
if (this.activatedRoute.snapshot.fragment === '') {
|
||||
this.criteria = onChange(createGenericObject<ListingCriteria>(), getSessionStorageHandler);
|
||||
this.first = 0;
|
||||
}
|
||||
this.init();
|
||||
});
|
||||
@@ -73,16 +73,15 @@ export class BrokerListingsComponent {
|
||||
async init() {
|
||||
this.search();
|
||||
}
|
||||
refine() {
|
||||
this.criteria.start = 0;
|
||||
this.criteria.page = 0;
|
||||
this.search();
|
||||
}
|
||||
async search() {
|
||||
const usersReponse = await this.userService.search(this.criteria);
|
||||
this.users = usersReponse.data;
|
||||
this.totalRecords = usersReponse.total;
|
||||
const profiles = await this.imageService.getProfileImagesForUsers(this.users.map(u => u.id));
|
||||
const logos = await this.imageService.getCompanyLogosForUsers(this.users.map(u => u.id));
|
||||
this.users.forEach(u => {
|
||||
u.hasProfile = profiles[u.id];
|
||||
u.hasCompanyLogo = logos[u.id];
|
||||
});
|
||||
this.cdRef.markForCheck();
|
||||
this.cdRef.detectChanges();
|
||||
}
|
||||
@@ -93,7 +92,7 @@ export class BrokerListingsComponent {
|
||||
this.criteria.pageCount = event.pageCount;
|
||||
this.search();
|
||||
}
|
||||
imageErrorHandler(listing: ListingType) {
|
||||
// listing.hideImage = true; // Bild ausblenden, wenn es nicht geladen werden kann
|
||||
reset() {
|
||||
this.criteria.name = '';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user