fix ออกคำสั่ง, email keycloak

This commit is contained in:
Bright 2024-10-16 16:34:36 +07:00
parent e59f4f13e2
commit a0398c9354

View file

@ -2286,7 +2286,7 @@ export class CommandController extends Controller {
const userKeycloakId = await createUser(profile.citizenId, profile.citizenId, { const userKeycloakId = await createUser(profile.citizenId, profile.citizenId, {
firstName: profile.firstName, firstName: profile.firstName,
lastName: profile.lastName, lastName: profile.lastName,
email: profile.email, // email: profile.email,
}); });
if (typeof userKeycloakId !== "string") { if (typeof userKeycloakId !== "string") {
throw new Error(userKeycloakId.errorMessage); throw new Error(userKeycloakId.errorMessage);
@ -2305,6 +2305,7 @@ export class CommandController extends Controller {
); );
if (!result) throw new Error("Failed. Cannot set user's role."); if (!result) throw new Error("Failed. Cannot set user's role.");
profile.keycloak = userKeycloakId; profile.keycloak = userKeycloakId;
profile.email = item.bodyProfile.email;
await this.profileRepository.save(profile); await this.profileRepository.save(profile);
setLogDataDiff(req, { before, after: profile }); setLogDataDiff(req, { before, after: profile });
} }
@ -2773,7 +2774,7 @@ export class CommandController extends Controller {
case "C-PM-05": case "C-PM-05":
return "/placement/appointment/appoint/report"; return "/placement/appointment/appoint/report";
case "C-PM-06": case "C-PM-06":
return "/placement/appointment/slip/report"; return "/placement/slip/report";
case "C-PM-07": case "C-PM-07":
return "/placement/appointment/move/report"; return "/placement/appointment/move/report";
case "C-PM-08": case "C-PM-08":
@ -2839,7 +2840,7 @@ export class CommandController extends Controller {
case "C-PM-38": case "C-PM-38":
return "/org/command/command38/officer/report"; return "/org/command/command38/officer/report";
case "C-PM-39": case "C-PM-39":
return "/placement/slip/report"; return "/placement/appointment/slip/report";
case "C-PM-40": case "C-PM-40":
return "/org/command/command40/officer/report"; return "/org/command/command40/officer/report";
case "C-PM-41": case "C-PM-41":