Aufteilung details in user & listings, listings by user
This commit is contained in:
@@ -19,10 +19,11 @@ export class BusinessListingsController {
|
||||
findById(@Param('id') id:string): any {
|
||||
return this.listingsService.getBusinessListingById(id);
|
||||
}
|
||||
// @Get(':type/:location/:minPrice/:maxPrice/:realEstateChecked')
|
||||
// find(@Param('type') type:string,@Param('location') location:string,@Param('minPrice') minPrice:string,@Param('maxPrice') maxPrice:string,@Param('realEstateChecked') realEstateChecked:boolean): any {
|
||||
// return this.listingsService.find(type,location,minPrice,maxPrice,realEstateChecked);
|
||||
// }
|
||||
@Get('user/:userid')
|
||||
findByUserId(@Param('userid') userid:string): any {
|
||||
return this.listingsService.getBusinessListingByUserId(userid);
|
||||
}
|
||||
|
||||
@Post('search')
|
||||
find(@Body() criteria: any): any {
|
||||
return this.listingsService.findBusinessListings(criteria);
|
||||
|
||||
@@ -83,6 +83,9 @@ export class ListingsService {
|
||||
async getBusinessListingById(id: string) {
|
||||
return await this.businessListingRepository.fetch(id)
|
||||
}
|
||||
async getBusinessListingByUserId(userid:string){
|
||||
return await this.businessListingRepository.search().where('userId').equals(userid).return.all()
|
||||
}
|
||||
async deleteBusinessListing(id: string){
|
||||
return await this.businessListingRepository.remove(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user