Ansichten verbessert - 1. Teil
This commit is contained in:
@@ -18,20 +18,20 @@ import { BusinessListing, ListingType, User } from '../../../../../../common-mod
|
||||
})
|
||||
export class MyListingComponent {
|
||||
user: User;
|
||||
listings: Array<BusinessListing> //dataListings as unknown as Array<BusinessListing>;
|
||||
myListings: Array<BusinessListing>
|
||||
listings: Array<ListingType> =[]//dataListings as unknown as Array<BusinessListing>;
|
||||
myListings: Array<ListingType>
|
||||
constructor(public userService: UserService,private listingsService:ListingsService, private cdRef:ChangeDetectorRef,public selectOptions:SelectOptionsService,private confirmationService: ConfirmationService,private messageService: MessageService){
|
||||
this.user=this.userService.getUser();
|
||||
|
||||
}
|
||||
async ngOnInit(){
|
||||
this.listings=await lastValueFrom(this.listingsService.getAllListings());
|
||||
// this.listings=await lastValueFrom(this.listingsService.getAllListings());
|
||||
this.myListings=this.listings.filter(l=>l.userId===this.user.id);
|
||||
}
|
||||
|
||||
async deleteListing(listing:ListingType){
|
||||
await this.listingsService.deleteListing(listing.id);
|
||||
this.listings=await lastValueFrom(this.listingsService.getAllListings());
|
||||
await this.listingsService.deleteListing(listing.id,listing.listingsCategory);
|
||||
// this.listings=await lastValueFrom(this.listingsService.getAllListings());
|
||||
this.myListings=this.listings.filter(l=>l.userId===this.user.id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user