From b1002d3da853ad520c776b6bd58a85f866b7e27e Mon Sep 17 00:00:00 2001 From: xXpuma99Xx <51341582+xXpuma99Xx@users.noreply.github.com> Date: Mon, 4 Apr 2022 23:13:55 -0500 Subject: [PATCH] primer end point --- src/institucion/institucion.controller.ts | 7 ++++++- src/institucion/institucion.service.ts | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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(); + } }