agregar y actualizar funciones en api-gateway
This commit is contained in:
parent
e2f0b401c5
commit
89469a687c
|
@ -128,6 +128,14 @@ export class AppController {
|
|||
return this.appService.deleteAdminSystem(id);
|
||||
}
|
||||
|
||||
@Post('user/changeStatus')
|
||||
changeStatusUser(
|
||||
@Body('id') pId: string,
|
||||
@Body('status') pStatus: string,
|
||||
) {
|
||||
return this.appService.changeStatusUser(pId, pStatus);
|
||||
}
|
||||
|
||||
// #==== API Communities
|
||||
@Post('community/createCommunity')
|
||||
createCommunity(
|
||||
|
@ -174,11 +182,11 @@ export class AppController {
|
|||
return this.appService.findCommunityAdmin(community_id);
|
||||
}
|
||||
@Post('community/changeStatus')
|
||||
changeStatus(
|
||||
changeStatusCommunity(
|
||||
@Body('id') pId: string,
|
||||
@Body('status') pStatus: string,
|
||||
) {
|
||||
return this.appService.changeStatus(pId, pStatus);
|
||||
return this.appService.changeStatusCommunity(pId, pStatus);
|
||||
}
|
||||
// #==== API Common Areas
|
||||
@Post('commonArea/createCommonArea')
|
||||
|
|
|
@ -18,7 +18,7 @@ export class AppService {
|
|||
@Inject('SERVICIO_REPORTES') private readonly clientReportApp: ClientProxy,
|
||||
@Inject('SERVICIO_NOTIFICACIONES')
|
||||
private readonly clientNotificationtApp: ClientProxy,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
// ====================== USERS ===============================
|
||||
|
||||
|
@ -179,13 +179,6 @@ export class AppService {
|
|||
.send<string>(pattern, payload)
|
||||
.pipe(map((message: string) => ({ message })));
|
||||
}
|
||||
changeStatus(pId: string, pStatus: string) {
|
||||
const pattern = { cmd: 'changeStatus' };
|
||||
const payload = { id: pId, status: pStatus };
|
||||
return this.clientCommunityApp
|
||||
.send<string>(pattern, payload)
|
||||
.pipe(map((message: string) => ({ message })));
|
||||
}
|
||||
|
||||
|
||||
//GET parameter from API
|
||||
|
@ -197,8 +190,23 @@ export class AppService {
|
|||
.pipe(map((message: string) => ({ message })));
|
||||
}
|
||||
|
||||
changeStatusUser(pId: string, pStatus: string) {
|
||||
const pattern = { cmd: 'changeStatus' };
|
||||
const payload = { id: pId, status: pStatus };
|
||||
return this.clientUserApp
|
||||
.send<string>(pattern, payload)
|
||||
.pipe(map((message: string) => ({ message })));
|
||||
}
|
||||
|
||||
|
||||
// ====================== COMMUNITIES ===============================
|
||||
changeStatusCommunity(pId: string, pStatus: string) {
|
||||
const pattern = { cmd: 'changeStatus' };
|
||||
const payload = { id: pId, status: pStatus };
|
||||
return this.clientCommunityApp
|
||||
.send<string>(pattern, payload)
|
||||
.pipe(map((message: string) => ({ message })));
|
||||
}
|
||||
|
||||
//POST parameter from API
|
||||
createCommunity(name: string, province: string, canton: string, district: string
|
||||
|
|
Loading…
Reference in New Issue