implemented new filter for tags when requesting list of events:

until now, filtering was done _after_ reading events from the db.
Now we first search viable appointment ids when tags are set and add these to the where clause for the actual request

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-01-03 23:17:45 +01:00
parent bf977ec886
commit fa8b5f2c57
3 changed files with 41 additions and 12 deletions
@@ -150,7 +150,7 @@ public class ApiEndpoint extends PathHandler {
Result<LocalDateTime> end = parseDate(param.get(END));
var endDate = (end == null) ? null: end.optional().orElse(null);
return db.list(startDate, endDate, count, offset).map(res -> filterByTags(res, tags));
return db.list(startDate, endDate, count, offset, tags).map(res -> filterByTags(res, tags));
}
private Result<List<Appointment>> filterByTags(Result<List<Appointment>> res, List<String> tags) {