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