show all listings, Bug Fixes

This commit is contained in:
2024-05-09 16:10:01 +02:00
parent 6b61c19bd7
commit d508415de4
29 changed files with 810 additions and 410 deletions

View File

@@ -18,7 +18,7 @@ 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 { createGenericObject, getCriteriaStateObject, getSessionStorageHandler } from '../../../utils/utils';
import { getCriteriaStateObject, getSessionStorageHandler, resetCriteria } from '../../../utils/utils';
@Component({
selector: 'app-business-listings',
@@ -65,15 +65,14 @@ export class BusinessListingsComponent {
private router: Router,
private cdRef: ChangeDetectorRef,
private imageService: ImageService,
private route: ActivatedRoute,
) {
this.criteria = onChange(getCriteriaStateObject(), getSessionStorageHandler);
this.router.getCurrentNavigation();
this.activatedRoute.snapshot;
this.activatedRoute.params.subscribe(params => {
if (this.activatedRoute.snapshot.fragment === '') {
this.criteria = onChange(createGenericObject<ListingCriteria>(), getSessionStorageHandler);
this.criteria.type = undefined;
this.route.data.subscribe(async () => {
if (!this.router.getCurrentNavigation().extras.state) {
resetCriteria(this.criteria);
}
this.category = (<any>params).type;
this.init();
});
}