Merge branch 'development' into 'devops-staging'
fix: resend user See merge request empatnusabangsa/ppob/ppob-backend!108
This commit is contained in:
commit
ca70f7cef4
|
@ -298,7 +298,11 @@ export class UsersController {
|
||||||
@Put('resend-user/:id')
|
@Put('resend-user/:id')
|
||||||
async resendUser(@Param('id', ParseUUIDPipe) id: string, @Request() req) {
|
async resendUser(@Param('id', ParseUUIDPipe) id: string, @Request() req) {
|
||||||
return {
|
return {
|
||||||
data: await this.usersService.confirmationUser(id, req.user, 'resend'),
|
data: await this.usersService.confirmationUser(
|
||||||
|
id,
|
||||||
|
req.user.userId,
|
||||||
|
'resend',
|
||||||
|
),
|
||||||
statusCode: HttpStatus.OK,
|
statusCode: HttpStatus.OK,
|
||||||
message: 'success',
|
message: 'success',
|
||||||
};
|
};
|
||||||
|
|
|
@ -571,12 +571,11 @@ export class UsersService {
|
||||||
const dataUser = await this.usersRepository.findOneOrFail(id);
|
const dataUser = await this.usersRepository.findOneOrFail(id);
|
||||||
const supervisorUser = await this.findExist(user);
|
const supervisorUser = await this.findExist(user);
|
||||||
|
|
||||||
|
|
||||||
if (status == 'approved') {
|
if (status == 'approved') {
|
||||||
if (supervisorUser.roles.name == 'Admin') {
|
if (supervisorUser.roles.name == 'Admin') {
|
||||||
dataUser.status_approval = 'Done';
|
dataUser.status_approval = 'Done';
|
||||||
dataUser.is_active = true;
|
dataUser.is_active = true;
|
||||||
}else {
|
} else {
|
||||||
dataUser.status_approval = supervisorUser.superior.id;
|
dataUser.status_approval = supervisorUser.superior.id;
|
||||||
}
|
}
|
||||||
} else if (status == 'resend') {
|
} else if (status == 'resend') {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user