diff --git a/src/institucion/institucion.controller.ts b/src/institucion/institucion.controller.ts index d38addb..8d6e25d 100644 --- a/src/institucion/institucion.controller.ts +++ b/src/institucion/institucion.controller.ts @@ -1,7 +1,12 @@ -import { Controller } from '@nestjs/common'; +import { Controller, Get } from '@nestjs/common'; import { InstitucionService } from './institucion.service'; @Controller('institucion') export class InstitucionController { constructor(private institucionService: InstitucionService) {} + + @Get() + get() { + return this.institucionService.findAllInstitucion(); + } } diff --git a/src/institucion/institucion.service.ts b/src/institucion/institucion.service.ts index d93ea24..1cea8b9 100644 --- a/src/institucion/institucion.service.ts +++ b/src/institucion/institucion.service.ts @@ -8,4 +8,8 @@ export class InstitucionService { constructor( @InjectRepository(Institucion) private repository: Repository, ) {} + + findAllInstitucion() { + return this.repository.find(); + } }