import { Controller , Get , Post , Body , Patch , Param , Delete , } from '@nestjs/common' ; import { CatsService } from './cats.service' ; import { CreateCatDto } from './dto/create-cat.dto' ; import { UpdateCatDto } from './dto/update-cat.dto' ; import { Observable } from 'rxjs' ; import { Cat } from './entities/cat.entity' ; import { AxiosResponse } from 'axios' ; @ Controller ( 'cats' ) export class CatsController { constructor ( private readonly catsService ) { } @ Post ( ) create ( @ Body ( ) createCatDto ) { return this . catsService . create ( createCatDto ) ; } @ Get ( ) findAll ( ) { return this . catsService . findAll ( ) ; } @ Get ( ':id' ) findOne ( @ Param ( 'id' ) id ) { return this . catsService . findOne ( + id ) ; } @ Patch ( ':id' ) update ( @ Param ( 'id' ) id , @ Body ( ) updateCatDto ) { return this . catsService . update ( + id , updateCatDto ) ; } @ Delete ( ':id' ) remove ( @ Param ( 'id' ) id ) { return this . catsService . remove ( + id ) ; } }