fixes on saving entities with code

This commit is contained in:
CITE\spapacharalampous 2024-08-27 10:07:46 +03:00
parent d015c06fef
commit f972e8305f
1 changed files with 0 additions and 2 deletions

View File

@ -211,8 +211,6 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
if (isUpdate) {
this.entityManager.merge(data);
} else {
Long descriptionTemplateCodes = this.queryFactory.query(DescriptionTemplateQuery.class).disableTracking().codes(model.getCode()).count();
if (descriptionTemplateCodes > 0) throw new MyValidationException(this.errors.getDescriptionTemplateCodeExists().getCode(), this.errors.getDescriptionTemplateCodeExists().getMessage());
this.entityManager.persist(data);
this.accountingService.increase(UsageLimitTargetMetric.DESCRIPTION_TEMPLATE_COUNT.getValue());
}