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

@@ -5,7 +5,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { MessageService } from 'primeng/api';
import { GalleriaModule } from 'primeng/galleria';
import { Observable } from 'rxjs';
import { BusinessListing, User } from '../../../../../../bizmatch-server/src/models/db.model';
import { BusinessListing, CommercialPropertyListing, User } from '../../../../../../bizmatch-server/src/models/db.model';
import { KeyValue, ListingCriteria } from '../../../../../../bizmatch-server/src/models/main.model';
import { environment } from '../../../../environments/environment';
import { ImageService } from '../../../services/image.service';
@@ -28,7 +28,8 @@ export class DetailsUserComponent {
user$: Observable<User>;
environment = environment;
criteria: ListingCriteria;
userListings: BusinessListing[];
businessListings: BusinessListing[];
commercialPropListings: CommercialPropertyListing[];
companyOverview: SafeHtml;
offeredServices: SafeHtml;
userLicensedIn: KeyValue[];
@@ -49,7 +50,10 @@ export class DetailsUserComponent {
this.userLicensedIn = this.user.licensedIn.map(l => {
return { name: l.split('|')[0], value: l.split('|')[1] };
});
this.userListings = await this.listingsService.getListingByUserId(this.id);
const results = await Promise.all([await this.listingsService.getListingByUserId(this.id, 'business'), await this.listingsService.getListingByUserId(this.id, 'commercialProperty')]);
// Zuweisen der Ergebnisse zu den Member-Variablen der Klasse
this.businessListings = results[0];
this.commercialPropListings = results[1];
this.user$ = this.userService.getUserObservable();
this.companyOverview = this.sanitizer.bypassSecurityTrustHtml(this.user.companyOverview);
this.offeredServices = this.sanitizer.bypassSecurityTrustHtml(this.user.offeredServices);