diff --git a/src/controllers/PosLevelController.ts b/src/controllers/PosLevelController.ts index e68abd07..73a437e8 100644 --- a/src/controllers/PosLevelController.ts +++ b/src/controllers/PosLevelController.ts @@ -79,7 +79,7 @@ export class PosLevelController extends Controller { if (chkPosLevelName) { throw new HttpError( HttpStatusCode.NOT_FOUND, - "ชื่อระดับตำแหน่ง: " + requestBody.posLevelName + " มีอยู่ในระบบแล้ว", + "ชื่อระดับตำแหน่งนี้มีอยู่ในระบบแล้ว", ); } @@ -143,7 +143,7 @@ export class PosLevelController extends Controller { if (chkPosLevelName) { throw new HttpError( HttpStatusCode.NOT_FOUND, - "ชื่อระดับตำแหน่ง: " + requestBody.posLevelName + " มีอยู่ในระบบแล้ว", + "ชื่อระดับตำแหน่งนี้มีอยู่ในระบบแล้ว", ); } const validPosLevelAuthority = ["HEAD", "DEPUTY", "GOVERNOR"]; diff --git a/src/controllers/PosTypeController.ts b/src/controllers/PosTypeController.ts index 9cc1b99d..38523097 100644 --- a/src/controllers/PosTypeController.ts +++ b/src/controllers/PosTypeController.ts @@ -64,7 +64,7 @@ export class PosTypeController extends Controller { if (chkPosTypeName) { throw new HttpError( HttpStatusCode.NOT_FOUND, - "ชื่อประเภทตำแหน่ง: " + requestBody.posTypeName + " มีอยู่ในระบบแล้ว", + "ชื่อประเภทตำแหน่งนี้มีอยู่ในระบบแล้ว", ); } posType.createdUserId = request.user.sub; @@ -105,7 +105,7 @@ export class PosTypeController extends Controller { if (chkPosTypeName) { throw new HttpError( HttpStatusCode.NOT_FOUND, - "ชื่อประเภทตำแหน่ง: " + requestBody.posTypeName + " มีอยู่ในระบบแล้ว", + "ชื่อประเภทตำแหน่งนี้มีอยู่ในระบบแล้ว", ); } posType.lastUpdateUserId = request.user.sub; @@ -172,7 +172,7 @@ export class PosTypeController extends Controller { where: { id: id }, }); if (!getPosType) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไไม่พบข้อมูลประเภทตำแหน่งนี้"); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลประเภทตำแหน่งนี้"); } const mapGetPosType = { diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 3e44e046..6f294846 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -57,7 +57,7 @@ export class ProfileController extends Controller { where: { citizenId: requestBody.citizenId }, }); if (_profile) { - throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, "เลขบัตรนี้มีอยู่ในระบบแล้ว"); + throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว"); } if (requestBody.posLevelId == "") { requestBody.posLevelId = null; @@ -90,7 +90,7 @@ export class ProfileController extends Controller { if (checkCitizenId) { throw new HttpError( HttpStatusCode.NOT_FOUND, - "มีรหัสประจำตัวประชาชนนี้แล้วในระบบ (citizenId)", + "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว", ); } @@ -126,7 +126,7 @@ export class ProfileController extends Controller { where: { id: Not(id), citizenId: requestBody.citizenId }, }); if (_profile) { - throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, "เลขบัตรนี้มีอยู่ในระบบแล้ว"); + throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว"); } if (requestBody.posLevelId == "") { @@ -163,7 +163,7 @@ export class ProfileController extends Controller { if (checkCitizenId) { throw new HttpError( HttpStatusCode.NOT_FOUND, - "มีรหัสประจำตัวประชาชนนี้แล้วในระบบ (citizenId)", + "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว", ); } @@ -781,7 +781,7 @@ export class ProfileController extends Controller { where: { id: Not(id), citizenId: requestBody.citizenId }, }); if (profile) { - throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, "เลขบัตรนี้มีอยู่ในระบบแล้ว"); + throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, "เลขประจำตัวประชาชนนี้มีอยู่ในระบบแล้ว"); } return new HttpSuccess(); } diff --git a/src/controllers/RankController.ts b/src/controllers/RankController.ts index 2e147a79..6f4018d9 100644 --- a/src/controllers/RankController.ts +++ b/src/controllers/RankController.ts @@ -75,7 +75,7 @@ export class RankController extends Controller { ) { const rank = await this.rankRepository.findOne({ where: { id: id } }); if (!rank) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลยศนี้"); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งนี้"); } const checkName = await this.rankRepository.findOne({ @@ -106,7 +106,7 @@ export class RankController extends Controller { where: { id }, }); if (!delRank) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลยศนี้"); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งนี้"); } await this.rankRepository.delete({ id: id }); return new HttpSuccess();