Ignore:
Timestamp:
09/11/22 18:03:58 (2 years ago)
Author:
Marko <Marko@…>
Branches:
master
Children:
775e15e
Parents:
527b93f
Message:

Prototype version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/PhoneOfferService.java

    r527b93f re5b84dc  
    3030    }
    3131
     32    public PhoneOffer getPhoneOffer(Long offerId){
     33        boolean exists = phoneOfferRepository.existsById(offerId);
     34
     35        if(!exists)
     36            throw new IllegalStateException("Phone offer with id "+offerId+" does not exist");
     37
     38        return phoneOfferRepository.findById(offerId).get();
     39    }
     40
     41
    3242    public List<String> getShops() {
    3343        return phoneOfferRepository.findAll().stream()
Note: See TracChangeset for help on using the changeset viewer.