Ansichten verbessert - 1. Teil
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import { Body, Controller, Delete, Get, Inject, Param, Post } from '@nestjs/common';
|
||||
import { Body, Controller, Delete, Get, Inject, Param, Post, UploadedFile, UseInterceptors } from '@nestjs/common';
|
||||
import { ListingsService } from './listings.service.js';
|
||||
import { WINSTON_MODULE_PROVIDER } from 'nest-winston';
|
||||
import { Logger } from 'winston';
|
||||
import { FileInterceptor } from '@nestjs/platform-express';
|
||||
import { FileService } from '../file/file.service.js';
|
||||
|
||||
@Controller('commercial-property-listings')
|
||||
@Controller('listings/commercialProperty')
|
||||
export class CommercialPropertyListingsController {
|
||||
|
||||
constructor(private readonly listingsService:ListingsService,@Inject(WINSTON_MODULE_PROVIDER) private readonly logger: Logger) {
|
||||
constructor(private readonly listingsService:ListingsService,private fileService:FileService,@Inject(WINSTON_MODULE_PROVIDER) private readonly logger: Logger) {
|
||||
}
|
||||
|
||||
@Get()
|
||||
@@ -40,5 +42,15 @@ export class CommercialPropertyListingsController {
|
||||
deleteById(@Param('id') id:string){
|
||||
this.listingsService.deleteCommercialPropertyListing(id)
|
||||
}
|
||||
|
||||
@Post('uploadPropertyPicture/:id')
|
||||
@UseInterceptors(FileInterceptor('file'),)
|
||||
uploadFile(@UploadedFile() file: Express.Multer.File,@Param('id') id:string) {
|
||||
this.fileService.storePropertyPicture(file,id);
|
||||
}
|
||||
|
||||
@Get('images/:id')
|
||||
getPropertyImagesById(@Param('id') id:string): any {
|
||||
return this.fileService.getPropertyImages(id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user