From 2972d6ef5ec083f366a868424f337c697acc25fa Mon Sep 17 00:00:00 2001 From: Bright Date: Mon, 18 Mar 2024 09:50:23 +0700 Subject: [PATCH] =?UTF-8?q?fix=20=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84?= =?UTF-8?q?=E0=B8=82=E0=B8=95=E0=B8=B3=E0=B9=81=E0=B8=AB=E0=B8=99=E0=B9=88?= =?UTF-8?q?=E0=B8=87=E0=B8=97=E0=B8=B2=E0=B8=87=E0=B8=81=E0=B8=B2=E0=B8=A3?= =?UTF-8?q?=E0=B8=9A=E0=B8=A3=E0=B8=B4=E0=B8=AB=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/PosExecutiveController.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controllers/PosExecutiveController.ts b/src/controllers/PosExecutiveController.ts index ad62da32..3da598d0 100644 --- a/src/controllers/PosExecutiveController.ts +++ b/src/controllers/PosExecutiveController.ts @@ -14,6 +14,7 @@ import { Get, Example, } from "tsoa"; +import { Not } from "typeorm" import { AppDataSource } from "../database/data-source"; import HttpSuccess from "../interfaces/http-success"; import HttpStatusCode from "../interfaces/http-status"; @@ -81,7 +82,10 @@ export class PosExecutiveController extends Controller { } const checkName = await this.posExecutiveRepository.findOne({ - where: { posExecutiveName: requestBody.posExecutiveName }, + where: { + id: Not(id), + posExecutiveName: requestBody.posExecutiveName + }, }); if (checkName) {