Skip to content

Commit

Permalink
fix(Backend): Fix body implementation with edc disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiodmota committed Jan 25, 2024
1 parent 532d136 commit f9d66cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ private List<BusinessPartnerDTO> filterBusinessPartnersByRole(List<BusinessPartn
List<BusinessPartnerDTO> filteredBusinessPartnerDTOS;
log.debug("Roles {}",roles);
log.debug("Code Roles {} {}",CSV_ROLE_READ_SUPPLIER,CSV_ROLE_READ_CUSTOMER);
if (roles.contains(CSV_ROLE_READ_SUPPLIER) && roles.contains(CSV_ROLE_READ_CUSTOMER)) {

if (roles.stream().anyMatch(role -> role.equalsIgnoreCase(CSV_ROLE_READ_SUPPLIER)) &&
roles.stream().anyMatch(role -> role.equalsIgnoreCase(CSV_ROLE_READ_CUSTOMER))) {
// User has both roles, no need to filter
filteredBusinessPartnerDTOS = businessPartnerDTOS;
} else if (roles.contains(CSV_ROLE_READ_SUPPLIER)) {
} else if (roles.stream().anyMatch(role -> role.equalsIgnoreCase(CSV_ROLE_READ_SUPPLIER))) {
// User can only read suppliers and those who are not customers
filteredBusinessPartnerDTOS = filterSuppliers(businessPartnerDTOS);
} else if (roles.contains(CSV_ROLE_READ_CUSTOMER)) {
} else if (roles.stream().anyMatch(role -> role.equalsIgnoreCase(CSV_ROLE_READ_CUSTOMER))) {
// User can only read customers and those who are not suppliers
filteredBusinessPartnerDTOS = filterCustomers(businessPartnerDTOS);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private List<BusinessPartnerDTO> handleSequentialRequests() {
private List<BusinessPartnerDTO> handleNonSequentialRequests() {
List<BusinessPartnerDTO> finalDtoList = new ArrayList<>();

String body = "[\"\"]";
String body = "[]";
HttpEntity<Object> httpEntity = createHttpEntity(body);

log.info("Sequential requests not enabled. Starting process to fetch external business partners from generic.");
Expand Down

0 comments on commit f9d66cf

Please sign in to comment.