Applied validation
This commit is contained in:
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user