diff --git a/api-gateway/src/app.controller.ts b/api-gateway/src/app.controller.ts index 20a6ee27..53442500 100644 --- a/api-gateway/src/app.controller.ts +++ b/api-gateway/src/app.controller.ts @@ -191,6 +191,11 @@ export class AppController { return this.appService.findCommonArea(paramCommonAreaId); } + @Get('commonArea//findByCommunity/:community_id') + findByCommunity(@Param('community_id') paramCommunityId: string) { + return this.appService.findByCommunity(paramCommunityId); + } + // #==== API GUEST //#API userService - create user @Post('guest/createGuest') diff --git a/api-gateway/src/app.service.ts b/api-gateway/src/app.service.ts index 4b71002b..426764c0 100644 --- a/api-gateway/src/app.service.ts +++ b/api-gateway/src/app.service.ts @@ -248,6 +248,16 @@ export class AppService { .pipe(map((message: string) => ({ message }))); } + + //GET parameter from API + findByCommunity(paramCommunityId: string) { + const pattern = { cmd: 'findByCommunity' }; + const payload = { community_id: paramCommunityId }; + return this.clientCommonAreaApp + .send(pattern, payload) + .pipe(map((message: string) => ({ message }))); + } + // ====================== GUESTS =============================== //POST parameter from API