agregar manejo de DELETE the comunicados en controlador de API

This commit is contained in:
Eduardo Quiros 2022-08-23 00:09:14 -06:00
parent 6c6b944da7
commit 1fd25ee469
No known key found for this signature in database
GPG Key ID: B77F36C3F12720B4
1 changed files with 13 additions and 8 deletions

View File

@ -2,7 +2,7 @@ import { Controller, Get, Post, Put, Body, Param, Delete } from '@nestjs/common'
import { AppService } from './app.service'; import { AppService } from './app.service';
@Controller() @Controller()
export class AppController { export class AppController {
constructor(private readonly appService: AppService) {} constructor(private readonly appService: AppService) { }
// #==== API Users // #==== API Users
@Post('user/createAdminSystem') @Post('user/createAdminSystem')
createAdminSystem( createAdminSystem(
@ -15,8 +15,8 @@ export class AppController {
@Body('status') status: string, @Body('status') status: string,
@Body('date_entry') date_entry: Date, @Body('date_entry') date_entry: Date,
) { ) {
return this.appService.createAdminSystem(dni, name, last_name, email, phone, return this.appService.createAdminSystem(dni, name, last_name, email, phone,
user_type, status, date_entry); user_type, status, date_entry);
} }
@Post('user/createGuard') @Post('user/createGuard')
@ -33,7 +33,7 @@ export class AppController {
@Body('community_id') community_id: string, @Body('community_id') community_id: string,
) { ) {
return this.appService.createGuard(dni, name, last_name, email, phone, return this.appService.createGuard(dni, name, last_name, email, phone,
user_type, status, date_entry,community_id); user_type, status, date_entry, community_id);
} }
@Post('user/createAdminCommunity') @Post('user/createAdminCommunity')
@ -47,10 +47,10 @@ export class AppController {
@Body('user_type') user_type: string, @Body('user_type') user_type: string,
@Body('status') status: string, @Body('status') status: string,
@Body('date_entry') date_entry: Date, @Body('date_entry') date_entry: Date,
@Body('community_id') community_id:string @Body('community_id') community_id: string
) { ) {
return this.appService.createAdminCommunity(dni, name, last_name, email, phone, return this.appService.createAdminCommunity(dni, name, last_name, email, phone,
user_type, status, date_entry,community_id); user_type, status, date_entry, community_id);
} }
@Post('user/createUser') @Post('user/createUser')
@ -174,7 +174,7 @@ export class AppController {
allUsersTenants(@Param('community_id') paramCommunity_id: string) { allUsersTenants(@Param('community_id') paramCommunity_id: string) {
return this.appService.findTenantsCommunity(paramCommunity_id); return this.appService.findTenantsCommunity(paramCommunity_id);
} }
@Get('user/find/:dni') @Get('user/find/:dni')
findUser(@Param('dni') paramUserDNI: string) { findUser(@Param('dni') paramUserDNI: string) {
return this.appService.findUser(paramUserDNI); return this.appService.findUser(paramUserDNI);
@ -261,7 +261,7 @@ export class AppController {
return this.appService.changeStatusCommunity(pId, pStatus); return this.appService.changeStatusCommunity(pId, pStatus);
} }
// #==== API Common Areas // #==== API Common Areas
@Post('commonArea/createCommonArea') @Post('commonArea/createCommonArea')
createCommonArea( createCommonArea(
@ -428,6 +428,11 @@ export class AppController {
return this.appService.findPost(paramPost); return this.appService.findPost(paramPost);
} }
@Delete('post/deletePost/:id')
deletePost(@Param('id') id: string) {
return this.appService.deletePost(id);
}
// #==== API Comment // #==== API Comment
@Post('post/createComment') @Post('post/createComment')