This commit is contained in:
AdisakKanthawilang 2025-07-16 17:19:24 +07:00
parent 6486eff055
commit 78810b0425

View file

@ -66,10 +66,13 @@ export class KpiUserDevelopmentController extends Controller {
}
const chkName = await this.kpiUserDevelopmentRepository.findOne({
where: { name: requestBody.name },
where: {
kpiUserEvaluationId: requestBody.kpiUserEvaluationId,
name: requestBody.name,
},
});
if (chkName) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "มีชื่อนี้ในระบบแล้ว");
throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อหัวข้อนี้มีอยู่แล้ว");
}
const kpiUserDevelopment = Object.assign(new KpiUserDevelopment(), requestBody);