diff --git a/src/main/java/com/codesdream/ase/repository/activity/ActivityRepository.java b/src/main/java/com/codesdream/ase/repository/activity/ActivityRepository.java index 6700258..aa5ea5b 100644 --- a/src/main/java/com/codesdream/ase/repository/activity/ActivityRepository.java +++ b/src/main/java/com/codesdream/ase/repository/activity/ActivityRepository.java @@ -18,6 +18,4 @@ public interface ActivityRepository extends JpaRepository { Optional findByCreator(String creatorName); - List findByUserAndType(User user, String type); - } \ No newline at end of file diff --git a/src/main/java/com/codesdream/ase/service/ActivityService.java b/src/main/java/com/codesdream/ase/service/ActivityService.java index 899acf3..9c42112 100644 --- a/src/main/java/com/codesdream/ase/service/ActivityService.java +++ b/src/main/java/com/codesdream/ase/service/ActivityService.java @@ -35,7 +35,15 @@ public class ActivityService implements IActivityService { @Override public List findActivityByType(User user, String type) { - return activityRepository.findByUserAndType(user, type); + + List activities = this.findAll(user); + List actsByType = new ArrayList<>(); + for (Activity activity : activities) { + if (activity.getType().equals(type)) { + actsByType.add(activity); + } + } + return actsByType; } @Override