From 02aaa63d092b9954d135380bc27b5cc8ea0058ba Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 28 Feb 2024 14:07:49 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20caption=20?= =?UTF-8?q?=E0=B9=84=E0=B8=AD=E0=B8=94=E0=B8=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/PosTypeController.ts | 2 +- src/controllers/ProfileController.ts | 12 ++++++------ src/controllers/ProfileSalaryController.ts | 6 +++--- src/controllers/RankController.ts | 4 ++-- src/controllers/RelationshipController.ts | 4 ++-- src/controllers/ReligionController.ts | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/controllers/PosTypeController.ts b/src/controllers/PosTypeController.ts index c09e8ec8..6c8163b9 100644 --- a/src/controllers/PosTypeController.ts +++ b/src/controllers/PosTypeController.ts @@ -136,7 +136,7 @@ export class PosTypeController extends Controller { where: { posTypeId: id } }) if(IdExitsInLevel.length > 0){ - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่สามารถลบได้ เนื่องจาก id ผูกกับ posLevel",); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่สามารถลบได้เนื่องจากพบข้อมูลที่ตารางระดับตำแหน่ง",); } try { diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 8aff61c3..ffc0f1b3 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -69,7 +69,7 @@ export class ProfileController extends Controller { if (!checkPosLevel) { throw new HttpError( HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลใน PosLevel จากไอดีนี้ : " + requestBody.posLevelId, + "ไม่พบข้อมูลระดับตำแหน่งนี้" ); } } @@ -84,7 +84,7 @@ export class ProfileController extends Controller { if (!checkPosType) { throw new HttpError( HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลใน PosType จากไอดีนี้ : " + requestBody.posTypeId, + "ไม่พบข้อมูลประเภทตำแหน่งนี้" ); } } @@ -129,7 +129,7 @@ export class ProfileController extends Controller { ) { const profile = await this.profileRepository.findOne({ where: { id: id } }); if (!profile) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์นี้"); } const _profile = await this.profileRepository.findOne({ @@ -149,7 +149,7 @@ export class ProfileController extends Controller { if (!checkPosLevel) { throw new HttpError( HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลใน PosLevel จากไอดีนี้ : " + requestBody.posLevelId, + "ไม่พบข้อมูลระดับตำแหน่งนี้" ); } } @@ -164,7 +164,7 @@ export class ProfileController extends Controller { if (!checkPosType) { throw new HttpError( HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลใน PosType จากไอดีนี้ : " + requestBody.posTypeId, + "ไม่พบข้อมูลประเภทตำแหน่งนี้" ); } } @@ -207,7 +207,7 @@ export class ProfileController extends Controller { where: { id }, }); if (!delProfile) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งตามไอดีนี้ : " + id); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์นี้"); } try { await this.profileRepository.delete({ id: id }); diff --git a/src/controllers/ProfileSalaryController.ts b/src/controllers/ProfileSalaryController.ts index e657a2c5..a98e4182 100644 --- a/src/controllers/ProfileSalaryController.ts +++ b/src/controllers/ProfileSalaryController.ts @@ -55,7 +55,7 @@ export class ProfileSalaryController extends Controller { where: {id : profileSalary.profileId} }) if(!profile){ - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดี: "+ profileSalary.profileId); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์นี้"); } profileSalary.createdUserId = request.user.sub; @@ -83,7 +83,7 @@ export class ProfileSalaryController extends Controller { ) { const profileSalary = await this.profileSalaryRepository.findOne({ where: { id: id } }); if (!profileSalary) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดี: " + id); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์นี้"); } profileSalary.lastUpdateUserId = request.user.sub; @@ -107,7 +107,7 @@ export class ProfileSalaryController extends Controller { where: { id }, }); if (!delprofileSalary) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดี: " + id); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์นี้"); } try { await this.profileSalaryRepository.delete({ id: id }); diff --git a/src/controllers/RankController.ts b/src/controllers/RankController.ts index ccdda69a..22af28d2 100644 --- a/src/controllers/RankController.ts +++ b/src/controllers/RankController.ts @@ -79,7 +79,7 @@ export class RankController extends Controller { ) { const rank = await this.rankRepository.findOne({ where: { id: id } }); if (!rank) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลยศนี้"); } const checkName = await this.rankRepository.findOne({ @@ -114,7 +114,7 @@ export class RankController extends Controller { where: { id }, }); if (!delRank) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งตามไอดีนี้ : " + id); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลยศนี้"); } try { await this.rankRepository.delete({ id: id }); diff --git a/src/controllers/RelationshipController.ts b/src/controllers/RelationshipController.ts index 4c7e93d2..72bbdadf 100644 --- a/src/controllers/RelationshipController.ts +++ b/src/controllers/RelationshipController.ts @@ -79,7 +79,7 @@ export class RelationshipController extends Controller { ) { const relationship = await this.relationshipRepository.findOne({ where: { id: id } }); if (!relationship) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลสถานภาพนี้"); } const checkName = await this.relationshipRepository.findOne({ @@ -114,7 +114,7 @@ export class RelationshipController extends Controller { where: { id }, }); if (!delRelationship) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งตามไอดีนี้ : " + id); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลสถานภาพนี้"); } try { await this.relationshipRepository.delete({ id: id }); diff --git a/src/controllers/ReligionController.ts b/src/controllers/ReligionController.ts index 69aee17f..6e08bb45 100644 --- a/src/controllers/ReligionController.ts +++ b/src/controllers/ReligionController.ts @@ -79,7 +79,7 @@ export class ReligionController extends Controller { ) { const religion = await this.religionRepository.findOne({ where: { id: id } }); if (!religion) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดีนี้ : " + id); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลศาสนานี้"); } const checkName = await this.religionRepository.findOne({ @@ -114,7 +114,7 @@ export class ReligionController extends Controller { where: { id }, }); if (!delReligion) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งตามไอดีนี้ : " + id); + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลศาสนานี้"); } try { await this.religionRepository.delete({ id: id });