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 },