Ignore:
Timestamp:
10/12/24 21:32:15 (5 weeks ago)
Author:
macagaso <gasoskamarija@…>
Branches:
master
Parents:
743de55
Message:

Updated version

Location:
src/main/java/finki/it/terapijamkbackend/spring/services
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/finki/it/terapijamkbackend/spring/services/CouponsService.java

    r743de55 r43c9090  
    99import java.util.List;
    1010import java.util.Optional;
     11import java.util.stream.Collectors;
    1112
    1213@Service
     
    3334        return couponRepository.findByTitle(identifier);
    3435    }
     36    public List<String> getCouponNames() {
     37        return couponRepository.findAll().stream()
     38                .map(Coupon::getCode)
     39                .collect(Collectors.toList());
     40    }
    3541
    3642    public void save(Coupon coupon) {
  • src/main/java/finki/it/terapijamkbackend/spring/services/EventService.java

    r743de55 r43c9090  
    11package finki.it.terapijamkbackend.spring.services;
    22
    3 import finki.it.terapijamkbackend.spring.entities.Coupon;
    43import finki.it.terapijamkbackend.spring.entities.Event;
    54import finki.it.terapijamkbackend.spring.repositories.EventRepository;
    6 import finki.it.terapijamkbackend.spring.repositories.UserRepository;
    75import jakarta.persistence.EntityNotFoundException;
    86import org.springframework.beans.factory.annotation.Autowired;
  • src/main/java/finki/it/terapijamkbackend/spring/services/RequestService.java

    r743de55 r43c9090  
    4141    public List<Request> findRequestsByUsername(String username) {
    4242       User user=userRepository.findByUsername(username).orElse(null);
    43         System.out.println(user.getId());
    4443        return requestRepository.findRequestsForFreeAppointments(user.getId());
    4544    }
  • src/main/java/finki/it/terapijamkbackend/spring/services/UserService.java

    r743de55 r43c9090  
    5858            }
    5959
    60             return userRepository.save(existingUser); // Save the updated user back to the database
     60            return userRepository.save(existingUser);
    6161        } else {
    6262            throw new UserNotFoundException("User not found with username: " + username);
Note: See TracChangeset for help on using the changeset viewer.