ปั๊ม role เดิม
This commit is contained in:
parent
9f5f1af6e2
commit
c26aad70bd
1 changed files with 21 additions and 1 deletions
|
|
@ -2589,7 +2589,13 @@ export class CommandController extends Controller {
|
|||
}
|
||||
//ถ้ามีอยู่แล้วให้ใช้อันเดิม
|
||||
else {
|
||||
// const _roleKeycloaks = await getRoleMappings(checkUser[0].id);
|
||||
const rolesData = await getRoleMappings(checkUser[0].id);
|
||||
if(rolesData) {
|
||||
const _roleKeycloak = await this.roleKeycloakRepo.find({
|
||||
where: { name: In(rolesData.map((x:any) => x.name)) }
|
||||
});
|
||||
profile.roleKeycloaks = _roleKeycloak && _roleKeycloak.length > 0 ? _roleKeycloak : [];
|
||||
}
|
||||
profile.keycloak = checkUser[0].id;
|
||||
}
|
||||
profile.amount = item.amount ?? _null;
|
||||
|
|
@ -3942,6 +3948,13 @@ export class CommandController extends Controller {
|
|||
profile.keycloak = userKeycloakId && typeof userKeycloakId === "string" ? userKeycloakId : "";
|
||||
}
|
||||
else {
|
||||
const rolesData = await getRoleMappings(checkUser[0].id);
|
||||
if(rolesData) {
|
||||
const _roleKeycloak = await this.roleKeycloakRepo.find({
|
||||
where: { name: In(rolesData.map((x:any) => x.name)) }
|
||||
});
|
||||
profile.roleKeycloaks = _roleKeycloak && _roleKeycloak.length > 0 ? _roleKeycloak : [];
|
||||
}
|
||||
profile.keycloak = checkUser[0].id;
|
||||
}
|
||||
|
||||
|
|
@ -4339,6 +4352,13 @@ export class CommandController extends Controller {
|
|||
// End Create Keycloak
|
||||
}
|
||||
else {
|
||||
const rolesData = await getRoleMappings(checkUser[0].id);
|
||||
if(rolesData) {
|
||||
const _roleKeycloak = await this.roleKeycloakRepo.find({
|
||||
where: { name: In(rolesData.map((x:any) => x.name)) }
|
||||
});
|
||||
profile.roleKeycloaks = _roleKeycloak && _roleKeycloak.length > 0 ? _roleKeycloak : [];
|
||||
}
|
||||
profile.keycloak = checkUser[0].id;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue