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

@ -116,7 +116,12 @@ export class ProfileChangeNameController extends Controller {
setLogDataDiff(req, { before, after: profile });
if (profile != null && profile.keycloak != null) {
const result = await updateName(profile.keycloak, profile.firstName, profile.lastName);
const result = await updateName(
profile.keycloak,
profile.firstName,
profile.lastName,
profile.prefix,
);
if (!result) {
throw new Error(result.errorMessage);
}
@ -182,7 +187,12 @@ export class ProfileChangeNameController extends Controller {
// ปิดไว้ก่อนเพราะ error ต้องใช้ keycloak ที่มีสิทธิ์ในการ update //update 17/07
if (profile != null && profile.keycloak != null) {
const result = await updateName(profile.keycloak, profile.firstName, profile.lastName);
const result = await updateName(
profile.keycloak,
profile.firstName,
profile.lastName,
profile.prefix,
);
if (!result) {
throw new Error(result.errorMessage);
}
@ -197,10 +207,7 @@ export class ProfileChangeNameController extends Controller {
* @param trainingId -
*/
@Patch("update-delete/{changeNameId}")
public async updateIsDeleted(
@Request() req: RequestWithUser,
@Path() changeNameId: string,
) {
public async updateIsDeleted(@Request() req: RequestWithUser, @Path() changeNameId: string) {
const record = await this.changeNameRepository.findOneBy({ id: changeNameId });
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
if (record.isDeleted === true) {