Ignore:
Timestamp:
10/18/21 00:19:16 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
188ee53
Parents:
fa375fe
Message:

editing location-form on frontend and backend

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/LocationServiceImpl.java

    rfa375fe reed0bf8  
    88
    99import java.util.*;
     10import java.util.stream.Collectors;
    1011
    1112
     
    4647    public Optional<Location> findById(Long id) {
    4748        return this.locationRepository.findById(id);
     49    }
     50
     51    @Override
     52    public List<Location> findLocations(Long locationId, Long companionId, Long lengthOfStay, String categoryIds) {
     53        List<Long> categories = null;
     54        if(categoryIds != null && !categoryIds.isEmpty()){
     55            List<String> ids = Arrays.asList(categoryIds.split(","));
     56            categories = ids.stream().map(Long::valueOf).collect(Collectors.toList());
     57        }
     58        List<Location> foundLocations = locationRepository.findLocationsFromForm(locationId, companionId, categories);
     59        return foundLocations;
    4860    }
    4961
Note: See TracChangeset for help on using the changeset viewer.