Merge branch 'development' into 'devops-staging'
fix approval user See merge request empatnusabangsa/ppob/ppob-backend!102
This commit is contained in:
commit
523cc31ff4
|
@ -73,7 +73,7 @@ export class UsersService {
|
||||||
approvalRole = 'Admin';
|
approvalRole = 'Admin';
|
||||||
}
|
}
|
||||||
userData.superior = superior;
|
userData.superior = superior;
|
||||||
userData.status_approval = approvalRole;
|
userData.status_approval = superior.superior.id;
|
||||||
} else {
|
} else {
|
||||||
userData.superior = null;
|
userData.superior = null;
|
||||||
userData.partner = createUserDto.partner;
|
userData.partner = createUserDto.partner;
|
||||||
|
@ -311,8 +311,7 @@ export class UsersService {
|
||||||
'user.id != :id and user.superior_id = :superior and status_approval = :status and is_rejected is false',
|
'user.id != :id and user.superior_id = :superior and status_approval = :status and is_rejected is false',
|
||||||
{
|
{
|
||||||
id: superrior.userId,
|
id: superrior.userId,
|
||||||
superior: superrior.userId,
|
status: superrior.userId,
|
||||||
status: dataUser.roles.name,
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.leftJoinAndSelect('user.roles', 'roles', `roles.id = user.roles_id`)
|
.leftJoinAndSelect('user.roles', 'roles', `roles.id = user.roles_id`)
|
||||||
|
@ -571,7 +570,7 @@ export class UsersService {
|
||||||
const supervisorUser = await this.usersRepository.findOneOrFail(id);
|
const supervisorUser = await this.usersRepository.findOneOrFail(id);
|
||||||
|
|
||||||
if (status == 'approved') {
|
if (status == 'approved') {
|
||||||
dataUser.status_approval = supervisorUser.roles.name;
|
dataUser.status_approval = supervisorUser.superior.id;
|
||||||
} else if (status == 'resend') {
|
} else if (status == 'resend') {
|
||||||
dataUser.is_rejected = false;
|
dataUser.is_rejected = false;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user