This commit is contained in:
AdisakKanthawilang 2024-02-02 18:01:26 +07:00
parent 065d0fd7e5
commit 93373bc00f
4 changed files with 178 additions and 3 deletions

View file

@ -18,6 +18,7 @@ import HttpSuccess from "../interfaces/http-success";
import HttpStatusCode from "../interfaces/http-status";
import HttpError from "../interfaces/http-error";
import { CreateReligion, Religion } from "../entities/Religion";
import { Not } from "typeorm";
@Route("api/v1/org/religion")
@Tags("Religion")
@Security("bearerAuth")
@ -82,7 +83,7 @@ export class ReligionController extends Controller {
}
const checkName = await this.religionRepository.findOne({
where: { name: requestBody.name },
where: { id:Not(id),name: requestBody.name },
});
if (checkName) {