Skip to content

Commit

Permalink
Fixed backend query to properly grab repeating meal events Feedback f…
Browse files Browse the repository at this point in the history
…rom Saayeh 5th December 2024 #30
  • Loading branch information
chasevill committed Dec 11, 2024
1 parent 53e74c7 commit cf3bb47
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/.idea/dataSources.local.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified backend/omniplanner.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
@Repository
public interface MealEventsRepository extends JpaRepository<MealEvents, Integer> {
List<MealEvents> findByUserId(int userId);
@Query("SELECT f FROM MealEvents f WHERE f.userId = :userId AND f.event_date >= :currentTimeMillis ORDER BY f.event_date ASC")
@Query("SELECT f FROM MealEvents f WHERE f.userId = :userId AND (f.repeating = true OR f.event_date >= :currentTimeMillis) ORDER BY f.event_date ASC")
List<MealEvents> findUpcomingByUserId(@Param("userId") int userId, @Param("currentTimeMillis") Long currentTimeMillis);
}

0 comments on commit cf3bb47

Please sign in to comment.