BugFix:#100 handle BadRequestException

This commit is contained in:
Andreas Knuth 2024-09-04 17:59:16 +02:00
parent 624fa74eb6
commit 7807afbad3
1 changed files with 3 additions and 4 deletions

View File

@ -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);
}
}