ไม่เช็คประเภทคำสั่งซ้ำ
This commit is contained in:
parent
395ac1161e
commit
917ca75eb2
1 changed files with 12 additions and 12 deletions
|
|
@ -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 },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue