พบเลขบัตรให้ return id
This commit is contained in:
parent
c9a8f9dc4d
commit
e5f71ba90d
2 changed files with 29 additions and 31 deletions
|
|
@ -216,11 +216,9 @@ export class ProfileController extends Controller {
|
|||
@Request() request: RequestWithUser,
|
||||
@Body() body: CreateProfileAllFields,
|
||||
) {
|
||||
if (await this.profileRepo.findOneBy({ citizenId: body.citizenId })) {
|
||||
throw new HttpError(
|
||||
HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
"เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว",
|
||||
);
|
||||
const profileExist = await this.profileRepo.findOneBy({ citizenId: body.citizenId })
|
||||
if (profileExist) {
|
||||
return new HttpSuccess(profileExist.id);
|
||||
}
|
||||
|
||||
if (body.posLevelId === "") body.posLevelId = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue