BugFix:#100 handle BadRequestException
This commit is contained in:
@@ -16,10 +16,9 @@ export class UnknownListingsController {
|
||||
@UseGuards(OptionalJwtAuthGuard)
|
||||
@Get(':id')
|
||||
async findById(@Request() req, @Param('id') id: string): Promise<any> {
|
||||
const result = await this.businessListingsService.findBusinessesById(id, req.user);
|
||||
if (result) {
|
||||
return result;
|
||||
} else {
|
||||
try {
|
||||
return await this.businessListingsService.findBusinessesById(id, req.user);
|
||||
} catch (error) {
|
||||
return await this.propertyListingsService.findCommercialPropertiesById(id, req.user);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user