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