From e1bcdd3995b0d1ed4e9b855fb03f70e07461bd0e Mon Sep 17 00:00:00 2001 From: Mariela Date: Fri, 19 Aug 2022 00:19:15 -0600 Subject: [PATCH] api change status --- api-gateway/src/app.controller.ts | 10 ++++++++++ api-gateway/src/app.service.ts | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/api-gateway/src/app.controller.ts b/api-gateway/src/app.controller.ts index abc90be1..ea569ede 100644 --- a/api-gateway/src/app.controller.ts +++ b/api-gateway/src/app.controller.ts @@ -215,6 +215,8 @@ export class AppController { ) { return this.appService.changeStatusCommunity(pId, pStatus); } + + // #==== API Common Areas @Post('commonArea/createCommonArea') createCommonArea( @@ -254,6 +256,14 @@ export class AppController { return this.appService.deleteCommonArea(id); } + @Post('commonArea/changeStatus') + changeStatusCommonArea( + @Body('id') pId: string, + @Body('status') pStatus: string, + ) { + return this.appService.changeStatusCommonArea(pId, pStatus); + } + // #==== 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 a5df9129..9dc93a79 100644 --- a/api-gateway/src/app.service.ts +++ b/api-gateway/src/app.service.ts @@ -343,6 +343,15 @@ export class AppService { .pipe(map((message: string) => ({ message }))); } + changeStatusCommonArea(pId: string, pStatus: string) { + const pattern = { cmd: 'changeStatus' }; + const payload = { id: pId, status: pStatus }; + return this.clientCommonAreaApp + .send(pattern, payload) + .pipe(map((message: string) => ({ message }))); + } + + // ====================== GUESTS =============================== //POST parameter from API