SEO/AEO, Farb schema, breadcrumbs
This commit is contained in:
@@ -18,9 +18,10 @@ export class CommercialPropertyListingsController {
|
||||
) {}
|
||||
|
||||
@UseGuards(OptionalAuthGuard)
|
||||
@Get(':id')
|
||||
async findById(@Request() req, @Param('id') id: string): Promise<any> {
|
||||
return await this.listingsService.findCommercialPropertiesById(id, req.user as JwtUser);
|
||||
@Get(':slugOrId')
|
||||
async findById(@Request() req, @Param('slugOrId') slugOrId: string): Promise<any> {
|
||||
// Support both slug (e.g., "office-space-austin-tx-a3f7b2c1") and UUID
|
||||
return await this.listingsService.findCommercialBySlugOrId(slugOrId, req.user as JwtUser);
|
||||
}
|
||||
|
||||
@UseGuards(AuthGuard)
|
||||
@@ -64,9 +65,18 @@ export class CommercialPropertyListingsController {
|
||||
await this.listingsService.deleteListing(id);
|
||||
this.fileService.deleteDirectoryIfExists(imagePath);
|
||||
}
|
||||
|
||||
@UseGuards(AuthGuard)
|
||||
@Post('favorite/:id')
|
||||
async addFavorite(@Request() req, @Param('id') id: string) {
|
||||
await this.listingsService.addFavorite(id, req.user as JwtUser);
|
||||
return { success: true, message: 'Added to favorites' };
|
||||
}
|
||||
|
||||
@UseGuards(AuthGuard)
|
||||
@Delete('favorite/:id')
|
||||
async deleteFavorite(@Request() req, @Param('id') id: string) {
|
||||
await this.listingsService.deleteFavorite(id, req.user as JwtUser);
|
||||
return { success: true, message: 'Removed from favorites' };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user