Merge branch 'development' into 'devops-staging'
Development See merge request empatnusabangsa/ppob/ppob-backend!104
This commit is contained in:
		@@ -272,7 +272,11 @@ export class UsersController {
 | 
				
			|||||||
  @Put('approve-user/:id')
 | 
					  @Put('approve-user/:id')
 | 
				
			||||||
  async approveUser(@Param('id', ParseUUIDPipe) id: string, @Request() req) {
 | 
					  async approveUser(@Param('id', ParseUUIDPipe) id: string, @Request() req) {
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
      data: await this.usersService.confirmationUser(id, req.user, 'approved'),
 | 
					      data: await this.usersService.confirmationUser(
 | 
				
			||||||
 | 
					        id,
 | 
				
			||||||
 | 
					        req.user.userId,
 | 
				
			||||||
 | 
					        'approved',
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
      statusCode: HttpStatus.OK,
 | 
					      statusCode: HttpStatus.OK,
 | 
				
			||||||
      message: 'success',
 | 
					      message: 'success',
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
@@ -281,7 +285,11 @@ export class UsersController {
 | 
				
			|||||||
  @Put('reject-user/:id')
 | 
					  @Put('reject-user/:id')
 | 
				
			||||||
  async rejectUser(@Param('id', ParseUUIDPipe) id: string, @Request() req) {
 | 
					  async rejectUser(@Param('id', ParseUUIDPipe) id: string, @Request() req) {
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
      data: await this.usersService.confirmationUser(id, req.user, 'rejected'),
 | 
					      data: await this.usersService.confirmationUser(
 | 
				
			||||||
 | 
					        id,
 | 
				
			||||||
 | 
					        req.user.userId,
 | 
				
			||||||
 | 
					        'rejected',
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
      statusCode: HttpStatus.OK,
 | 
					      statusCode: HttpStatus.OK,
 | 
				
			||||||
      message: 'success',
 | 
					      message: 'success',
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -567,7 +567,7 @@ export class UsersService {
 | 
				
			|||||||
  async confirmationUser(id: string, user: string, status: string) {
 | 
					  async confirmationUser(id: string, user: string, status: string) {
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
      const dataUser = await this.usersRepository.findOneOrFail(id);
 | 
					      const dataUser = await this.usersRepository.findOneOrFail(id);
 | 
				
			||||||
      const supervisorUser = await this.usersRepository.findOneOrFail(id);
 | 
					      const supervisorUser = await this.findExist(user);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (status == 'approved') {
 | 
					      if (status == 'approved') {
 | 
				
			||||||
        dataUser.status_approval = supervisorUser.superior.id;
 | 
					        dataUser.status_approval = supervisorUser.superior.id;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user