fix command 08
This commit is contained in:
parent
04c200027f
commit
f7653aa4cf
1 changed files with 5 additions and 2 deletions
|
|
@ -2240,8 +2240,8 @@ export class CommandController extends Controller {
|
||||||
firstName: profile.firstName,
|
firstName: profile.firstName,
|
||||||
lastName: profile.lastName,
|
lastName: profile.lastName,
|
||||||
});
|
});
|
||||||
// กรณี Keycloak ไม่ถูกลบ ให้ลบซ้ำอีกรอบแล้วสร้างใหม่
|
// กรณี Keycloak ไม่ถูกลบ ให้ลบซ้ำอีกรอบแล้วสร้างใหม่ และหากยังไม่สามารถลบได้ให้แสดง Error
|
||||||
if (profile.keycloak != null && userKeycloakId && userKeycloakId.error === "User exists with same username") {
|
if (profile.keycloak != null && userKeycloakId && userKeycloakId.errorMessage === "User exists with same username") {
|
||||||
const delUserKeycloak = await deleteUser(profile.keycloak);
|
const delUserKeycloak = await deleteUser(profile.keycloak);
|
||||||
if(delUserKeycloak) {
|
if(delUserKeycloak) {
|
||||||
userKeycloakId = await createUser(profile.citizenId, profile.citizenId, {
|
userKeycloakId = await createUser(profile.citizenId, profile.citizenId, {
|
||||||
|
|
@ -2249,6 +2249,9 @@ export class CommandController extends Controller {
|
||||||
lastName: profile.lastName,
|
lastName: profile.lastName,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
throw new HttpError(HttpStatus.BAD_REQUEST, "พบข้อผิดพลาด ไม่สามารถจัดการผู้ใช้งานได้");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const list = await getRoles();
|
const list = await getRoles();
|
||||||
let result = false;
|
let result = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue