Subir carpetas con las nuevas tablas
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { Body, Controller, Delete, Get, Param, ParseIntPipe, Patch, Post } from '@nestjs/common';
|
||||
import { QrService } from './qr.service';
|
||||
import { Qr } from './qr.entity';
|
||||
import { CreateQrDto } from './dto/create-qr.dto';
|
||||
import { UpdateQrDto } from './dto/update.qr.dto';
|
||||
|
||||
@Controller('qr')
|
||||
export class QrController {
|
||||
|
||||
constructor(private qrService: QrService) {}
|
||||
|
||||
@Get()
|
||||
getQrs(): Promise<Qr[]> {
|
||||
return this.qrService.getQrs();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
getQr(@Param('id', ParseIntPipe) id: number) {
|
||||
return this.qrService.getQr(id);
|
||||
}
|
||||
|
||||
@Post() //en el body ValidationPipe
|
||||
createQr(@Body() newQr: CreateQrDto) {
|
||||
return this.qrService.createQr(newQr)
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
deleteQr(@Param('id', ParseIntPipe) id:number) {
|
||||
return this.qrService.deleteQr(id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
updateQr(@Param('id', ParseIntPipe) id: number, @Body() qr: UpdateQrDto) {
|
||||
return this.qrService.updateQr(id, qr)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user