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) {