This commit is contained in:
2024-09-11 16:51:42 +02:00
parent 8a7e26d2b6
commit 60866473f7
15 changed files with 135 additions and 117 deletions

View File

@@ -41,10 +41,6 @@ export class CommercialPropertyListingsController {
findTotal(@Request() req, @Body() criteria: CommercialPropertyListingCriteria): Promise<number> {
return this.listingsService.getCommercialPropertiesCount(criteria, req.user as JwtUser);
}
// @Get('states/all')
// getStates(): any {
// return this.listingsService.getStates();
// }
@Post()
async create(@Body() listing: any) {
this.logger.info(`Save Listing`);
@@ -55,13 +51,13 @@ export class CommercialPropertyListingsController {
this.logger.info(`Save Listing`);
return await this.listingsService.updateCommercialPropertyListing(listing.id, listing);
}
@Delete(':id/:imagePath')
@Delete('listing/:id/:imagePath')
deleteById(@Param('id') id: string, @Param('imagePath') imagePath: string) {
this.listingsService.deleteListing(id);
this.fileService.deleteDirectoryIfExists(imagePath);
}
@UseGuards(JwtAuthGuard)
@Delete('favorites/:id')
@Delete('favorite/:id')
deleteFavorite(@Request() req, @Param('id') id: string) {
this.listingsService.deleteFavorite(id, req.user as JwtUser);
}