import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { PacientiService } from './pacienti.service';
import { CreatePacientiDto } from './dto/create-pacienti.dto';
import { UpdatePacientiDto } from './dto/update-pacienti.dto';

@Controller('pacienti')
export class PacientiController {
  constructor(private readonly pacientiService: PacientiService) {}

  @Post()
  create(@Body() createPacientiDto: CreatePacientiDto) {
    return this.pacientiService.create(createPacientiDto);
  }

  @Get()
  findAll() {
    return this.pacientiService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.pacientiService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updatePacientiDto: UpdatePacientiDto) {
    return this.pacientiService.update(+id, updatePacientiDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.pacientiService.remove(+id);
  }
}
