BugFix:#100 handle BadRequestException
This commit is contained in:
parent
624fa74eb6
commit
7807afbad3
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue