fixed description template code validation
This commit is contained in:
parent
1149668e2f
commit
6e8eccecb1
|
@ -226,6 +226,9 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
|
|||
.groupIds(data.getGroupId())
|
||||
.count();
|
||||
if (activeDescriptionTemplatesForTheGroup > 0) throw new MyApplicationException("Description template group id is in use please use new version endpoint");
|
||||
|
||||
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.updateVersionStatusAndSave(data, previousStatus, data.getStatus());
|
||||
|
|
Loading…
Reference in New Issue