add plumbing to delete tenant
This commit is contained in:
		
							parent
							
								
									25344faca0
								
							
						
					
					
						commit
						11aff885e7
					
				|  | @ -160,6 +160,10 @@ export class AppController { | |||
|     return this.appService.deleteAdminCommunity(id); | ||||
|   } | ||||
| 
 | ||||
|   @Delete('user/deleteTenant/:id') | ||||
|   deleteTenant(@Param('id') id: string) { | ||||
|     return this.appService.deleteTenant(id); | ||||
|   } | ||||
| 
 | ||||
|   @Post('user/changeStatus') | ||||
|   changeStatusUser( | ||||
|  |  | |||
|  | @ -54,8 +54,8 @@ export class AppService { | |||
|   } | ||||
| 
 | ||||
|   updateUser( | ||||
|     dni: string,  | ||||
|     name: string,  | ||||
|     dni: string, | ||||
|     name: string, | ||||
|     last_name: string, | ||||
|     email: string, | ||||
|     phone: number, | ||||
|  | @ -201,6 +201,14 @@ export class AppService { | |||
|       .pipe(map((message: string) => ({ message }))); | ||||
|   } | ||||
| 
 | ||||
|   deleteTenant(id: string) { | ||||
|     const pattern = { cmd: 'deleteTenant' }; | ||||
|     const payload = { id: id }; | ||||
|     return this.clientUserApp | ||||
|       .send<string>(pattern, payload) | ||||
|       .pipe(map((message: string) => ({ message }))); | ||||
|   } | ||||
| 
 | ||||
|   inicioSesion(pEmail: string, pPassword: string) { | ||||
|     const pattern = { cmd: 'loginUser' }; | ||||
|     const payload = { email: pEmail, password: pPassword }; | ||||
|  |  | |||
|  | @ -115,13 +115,15 @@ export class UsersController { | |||
|     return this.userService.deleteAdminSystem(user['id']); | ||||
|   } | ||||
| 
 | ||||
|    | ||||
|   @MessagePattern({ cmd: 'deleteAdminCommunity' }) | ||||
|   deleteAdminCommunity(@Payload() user: any) { | ||||
|     return this.userService.deleteAdminCommunity(user['id']); | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
|   @MessagePattern({ cmd: 'deleteTenant' }) | ||||
|   deleteTenant(@Payload() user: any) { | ||||
|     return this.userService.deleteTenant(user['id']); | ||||
|   } | ||||
| 
 | ||||
|   @MessagePattern({ cmd: 'changeStatus' }) | ||||
|   changeStatus(@Payload() body: string) { | ||||
|  |  | |||
|  | @ -189,7 +189,6 @@ export class UsersService { | |||
|     }); | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
|   deleteAdminCommunity(id: string) { | ||||
|     return this.userModel.findOneAndUpdate({ _id: id }, { status: '-1' }, { | ||||
|       new: true, | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue