Applied validation

This commit is contained in:
rajesh
2024-09-17 16:15:15 +05:30
parent 6959ac0a65
commit d2fed5e168
14 changed files with 57 additions and 10 deletions

View File

@@ -38,6 +38,9 @@ public class FormDao {
@Autowired
private ApplicationFormRepository applicationFormRepository;
@Autowired
private CallDao callDao;
public FormEntity saveFormEntity(FormEntity formEntity){
formEntity=formRepository.save(formEntity);
return formEntity;
@@ -72,6 +75,7 @@ public class FormDao {
}
public FormResponseBean updateForm(Long formId, FormRequest formRequest){
FormEntity formEntity = validateForm(formId);
callDao.validateUpdate(formEntity.getCall());
Utils.setIfUpdated(formEntity::getLabel,formEntity::setLabel,formRequest.getLabel());
Utils.setIfUpdated(formEntity::getContent,formEntity::setContent,setContentResponseBean(formRequest.getContent()));
formEntity.setUpdatedDate(DateTimeUtil.DateServerToUTC(LocalDateTime.now()));