changName update and validate citizenId
This commit is contained in:
parent
f1a8652587
commit
9506128842
4 changed files with 54 additions and 2 deletions
|
|
@ -195,6 +195,10 @@ export class ProfileController extends Controller {
|
|||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลประเภทตำแหน่งนี้");
|
||||
}
|
||||
|
||||
if (body.citizenId && (await this.profileRepo.findOneBy({ citizenId: body.citizenId }))) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ข้อมูลรหัสบัตรประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว");
|
||||
}
|
||||
|
||||
const profile = Object.assign(new Profile(), body);
|
||||
profile.isProbation = false;
|
||||
profile.isLeave = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue