fix update prefix and profileId
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m45s

This commit is contained in:
Warunee Tamkoo 2026-02-27 15:24:51 +07:00
parent e4f46a1762
commit 2951630b7b
10 changed files with 201 additions and 69 deletions

View file

@ -5,7 +5,7 @@ import { ProfileEmployee } from "../entities/ProfileEmployee";
// import { EmployeePosMaster } from "../entities/EmployeePosMaster";
// import { OrgRoot } from "../entities/OrgRoot";
import {
createUser,
createUserHaveProfile,
getUser,
getUserByUsername,
updateUserAttributes,
@ -809,12 +809,18 @@ export class KeycloakAttributeService {
}
// Create new user in Keycloak
const createResult = await createUser(profile.citizenId, "P@ssw0rd", {
firstName: profile.firstName || "",
lastName: profile.lastName || "",
email: profile.email || undefined,
enabled: true,
});
const createResult = await createUserHaveProfile(
profile.citizenId,
"P@ssw0rd",
profile.id,
profile.prefix,
{
firstName: profile.firstName || "",
lastName: profile.lastName || "",
email: profile.email || undefined,
enabled: true,
},
);
if (!createResult || typeof createResult !== "string") {
return {