added validation in call api
This commit is contained in:
@@ -8,6 +8,7 @@ import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.gepafin.tendermanagement.model.response.*;
|
||||
import net.gepafin.tendermanagement.service.LookUpDataService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -65,7 +66,8 @@ public class CallDao {
|
||||
|
||||
@Autowired
|
||||
private RegionRepository regionRepository;
|
||||
|
||||
@Autowired
|
||||
private LookUpDataService lookUpDataService;
|
||||
@Autowired
|
||||
private LookUpDataRepository lookUpDataRepository;
|
||||
|
||||
@@ -405,6 +407,7 @@ public class CallDao {
|
||||
LookUpDataEntity newEntity = new LookUpDataEntity();
|
||||
newEntity.setValue(req.getValue());
|
||||
newEntity.setType(type.getValue());
|
||||
lookUpDataService.validateLookUpDataEntity(newEntity);
|
||||
return lookUpDataRepository.save(newEntity);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user