Criteria Objekt überarbeitet

This commit is contained in:
2024-07-17 20:19:13 +02:00
parent bdafb03165
commit f88eebe8d3
22 changed files with 121 additions and 192 deletions

View File

@@ -9,7 +9,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 { getCriteriaStateObject, getSessionStorageHandler } from '../../../utils/utils';
import { getCriteriaStateObject, getSessionStorageHandlerWrapper } from '../../../utils/utils';
@Component({
selector: 'app-business-listings',
@@ -45,7 +45,7 @@ export class BusinessListingsComponent {
private imageService: ImageService,
private route: ActivatedRoute,
) {
this.criteria = onChange(getCriteriaStateObject('business'), getSessionStorageHandler);
this.criteria = onChange(getCriteriaStateObject('business'), getSessionStorageHandlerWrapper('business'));
this.route.data.subscribe(async () => {
if (this.router.getCurrentNavigation().extras.state) {
} else {
@@ -59,6 +59,7 @@ export class BusinessListingsComponent {
//initFlowbite();
}
async init() {
this.reset();
const statesResult = await this.listingsService.getAllStates('business');
this.states = statesResult.map(ls => ({ name: this.selectOptions.getState(ls.state as string), value: ls.state, count: ls.count }));
this.search();