update privilage validate (NORMAL) and update calRetireLaw

This commit is contained in:
Adisak 2025-10-17 16:05:42 +07:00
parent 897dda67ad
commit 5cdcc2a91e
4 changed files with 12 additions and 5 deletions

View file

@ -5262,6 +5262,7 @@ export class ProfileController extends Controller {
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์นี้");
Object.assign(record, body);
record.dateRetireLaw = calculateRetireLaw(record.birthDate);
record.prefixMain = record.prefix;
record.prefix = record.rank && record.rank.length > 0 ? record.rank : record.prefixMain;
record.createdUserId = request.user.sub;