Don't show future entries on /today endpoint
This commit is contained in:
parent
f9ce4d4db8
commit
ff1afd7c32
@ -45,7 +45,11 @@ public interface RecordRepository extends PagingAndSortingRepository<TimeRecord,
|
|||||||
Pageable pageable
|
Pageable pageable
|
||||||
);
|
);
|
||||||
|
|
||||||
@Query("SELECT record from TimeRecord record where record.account.user.username = :#{principal} AND record.enddate > current_date")
|
@Query("SELECT record from TimeRecord record " +
|
||||||
|
"where record.account.user.username = :#{principal} " +
|
||||||
|
"AND record.enddate > current_date " +
|
||||||
|
"AND record.enddate < current_date+1"
|
||||||
|
)
|
||||||
Page<TimeRecord> today(Pageable pageable);
|
Page<TimeRecord> today(Pageable pageable);
|
||||||
|
|
||||||
@RestResource(rel = "openEntries", path = "openEntries")
|
@RestResource(rel = "openEntries", path = "openEntries")
|
||||||
|
@ -34,6 +34,8 @@ INSERT INTO time_record (id, enddate, startdate, `type`, account_id) VALUES
|
|||||||
(6, '2020-05-30 23:00:00', '2020-05-30 22:00:00', 1, 1),
|
(6, '2020-05-30 23:00:00', '2020-05-30 22:00:00', 1, 1),
|
||||||
(7, '2020-05-31 01:00:00', '2020-05-31 00:00:00', 1, 1),
|
(7, '2020-05-31 01:00:00', '2020-05-31 00:00:00', 1, 1),
|
||||||
(8, '2020-05-31 04:00:00', '2020-05-31 02:00:00', 1, 1),
|
(8, '2020-05-31 04:00:00', '2020-05-31 02:00:00', 1, 1),
|
||||||
(9, '2020-05-31 16:00:00', '2020-05-31 12:00:00', 1, 1);
|
(9, '2020-05-31 16:00:00', '2020-05-31 12:00:00', 1, 1),
|
||||||
|
(10, '2020-06-14 16:00:00', '2020-06-14 12:00:00', 1, 1),
|
||||||
|
(11, '2020-06-15 16:00:00', '2020-06-15 12:00:00', 1, 1);
|
||||||
|
|
||||||
SET FOREIGN_KEY_CHECKS=1;
|
SET FOREIGN_KEY_CHECKS=1;
|
Loading…
Reference in New Issue
Block a user