Updated status code for validation in next-prev API
This commit is contained in:
@@ -17,6 +17,7 @@ import net.gepafin.tendermanagement.model.response.*;
|
|||||||
import net.gepafin.tendermanagement.service.ApplicationService;
|
import net.gepafin.tendermanagement.service.ApplicationService;
|
||||||
import net.gepafin.tendermanagement.util.Validator;
|
import net.gepafin.tendermanagement.util.Validator;
|
||||||
import net.gepafin.tendermanagement.web.rest.api.errors.CustomValidationException;
|
import net.gepafin.tendermanagement.web.rest.api.errors.CustomValidationException;
|
||||||
|
import net.gepafin.tendermanagement.web.rest.api.errors.ForbiddenAccessException;
|
||||||
import net.gepafin.tendermanagement.web.rest.api.errors.Status;
|
import net.gepafin.tendermanagement.web.rest.api.errors.Status;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -82,7 +83,7 @@ public class ApplicationServiceImpl implements ApplicationService {
|
|||||||
ApplicationEntity applicationEntity =null;
|
ApplicationEntity applicationEntity =null;
|
||||||
if(validator.checkIsBeneficiary()){
|
if(validator.checkIsBeneficiary()){
|
||||||
if(companyId==null){
|
if(companyId==null){
|
||||||
throw new CustomValidationException(Status.VALIDATION_ERROR,Translator.toLocale(GepafinConstant.COMPANY_ID_MANDATORY));
|
throw new ForbiddenAccessException(Status.FORBIDDEN,Translator.toLocale(GepafinConstant.COMPANY_ID_MANDATORY));
|
||||||
}
|
}
|
||||||
applicationEntity = validateApplicationWithCompany(applicationId, companyId);
|
applicationEntity = validateApplicationWithCompany(applicationId, companyId);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user