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 { CreateRelationship, Relationship } from "../entities/Relationship";
import { Not } from "typeorm";
@Route("api/v1/org/relationship")
@Tags("Relationship")
@Security("bearerAuth")
@ -82,7 +83,7 @@ export class RelationshipController extends Controller {
}
const checkName = await this.relationshipRepository.findOne({
where: { name: requestBody.name },
where: {id:Not(id),name: requestBody.name },
});
if (checkName) {