ไม่เช็คประเภทคำสั่งซ้ำ
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, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
}
|
||||||
|
|
||||||
const checkName = await this.commandTypeRepository.findOne({
|
// const checkName = await this.commandTypeRepository.findOne({
|
||||||
where: { name: requestBody.name },
|
// where: { name: requestBody.name },
|
||||||
});
|
// });
|
||||||
|
|
||||||
if (checkName) {
|
// if (checkName) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อนี้มีอยู่ในระบบแล้ว");
|
// throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อนี้มีอยู่ในระบบแล้ว");
|
||||||
}
|
// }
|
||||||
|
|
||||||
const checkNameSys = await this.commandSysRepository.findOne({
|
const checkNameSys = await this.commandSysRepository.findOne({
|
||||||
where: { id: requestBody.commandSysId },
|
where: { id: requestBody.commandSysId },
|
||||||
|
|
@ -187,12 +187,12 @@ export class CommandTypeController extends Controller {
|
||||||
if (!_commandType) {
|
if (!_commandType) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลประเภทคำสั่งชื่อนี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลประเภทคำสั่งชื่อนี้");
|
||||||
}
|
}
|
||||||
const checkName = await this.commandTypeRepository.findOne({
|
// const checkName = await this.commandTypeRepository.findOne({
|
||||||
where: { id: Not(id), name: requestBody.name },
|
// where: { id: Not(id), name: requestBody.name },
|
||||||
});
|
// });
|
||||||
if (checkName) {
|
// if (checkName) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อนี้มีอยู่ในระบบแล้ว");
|
// throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อนี้มีอยู่ในระบบแล้ว");
|
||||||
}
|
// }
|
||||||
|
|
||||||
const checkNameSys = await this.commandSysRepository.findOne({
|
const checkNameSys = await this.commandSysRepository.findOne({
|
||||||
where: { id: requestBody.commandSysId },
|
where: { id: requestBody.commandSysId },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue