From 917ca75eb282d26076e4c51a43af355a2d17963a Mon Sep 17 00:00:00 2001 From: kittapath Date: Fri, 20 Sep 2024 15:02:46 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=84=E0=B8=A1=E0=B9=88=E0=B9=80=E0=B8=8A?= =?UTF-8?q?=E0=B9=87=E0=B8=84=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B9=80=E0=B8=A0?= =?UTF-8?q?=E0=B8=97=E0=B8=84=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87?= =?UTF-8?q?=E0=B8=8B=E0=B9=89=E0=B8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/CommandTypeController.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/controllers/CommandTypeController.ts b/src/controllers/CommandTypeController.ts index 12973079..5884e9eb 100644 --- a/src/controllers/CommandTypeController.ts +++ b/src/controllers/CommandTypeController.ts @@ -143,13 +143,13 @@ export class CommandTypeController extends Controller { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล"); } - const checkName = await this.commandTypeRepository.findOne({ - where: { name: requestBody.name }, - }); + // const checkName = await this.commandTypeRepository.findOne({ + // where: { name: requestBody.name }, + // }); - if (checkName) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อนี้มีอยู่ในระบบแล้ว"); - } + // if (checkName) { + // throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อนี้มีอยู่ในระบบแล้ว"); + // } const checkNameSys = await this.commandSysRepository.findOne({ where: { id: requestBody.commandSysId }, @@ -187,12 +187,12 @@ export class CommandTypeController extends Controller { if (!_commandType) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลประเภทคำสั่งชื่อนี้"); } - const checkName = await this.commandTypeRepository.findOne({ - where: { id: Not(id), name: requestBody.name }, - }); - if (checkName) { - throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อนี้มีอยู่ในระบบแล้ว"); - } + // const checkName = await this.commandTypeRepository.findOne({ + // where: { id: Not(id), name: requestBody.name }, + // }); + // if (checkName) { + // throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อนี้มีอยู่ในระบบแล้ว"); + // } const checkNameSys = await this.commandSysRepository.findOne({ where: { id: requestBody.commandSysId },