caldav: add path to interface QueryCalendarObjects

This was missing for proper multi-calendar support.
This commit is contained in:
Conrad Hoffmann 2024-02-02 14:09:22 +01:00 committed by Simon Ser
parent 5b5b542f2f
commit e3ba95cd77
2 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ type Backend interface {
GetCalendar(ctx context.Context, path string) (*Calendar, error)
GetCalendarObject(ctx context.Context, path string, req *CalendarCompRequest) (*CalendarObject, error)
ListCalendarObjects(ctx context.Context, path string, req *CalendarCompRequest) ([]CalendarObject, error)
QueryCalendarObjects(ctx context.Context, query *CalendarQuery) ([]CalendarObject, error)
QueryCalendarObjects(ctx context.Context, path string, query *CalendarQuery) ([]CalendarObject, error)
PutCalendarObject(ctx context.Context, path string, calendar *ical.Calendar, opts *PutCalendarObjectOptions) (loc string, err error)
DeleteCalendarObject(ctx context.Context, path string) error
@ -213,7 +213,7 @@ func (h *Handler) handleQuery(r *http.Request, w http.ResponseWriter, query *cal
}
q.CompFilter = *cf
cos, err := h.Backend.QueryCalendarObjects(r.Context(), &q)
cos, err := h.Backend.QueryCalendarObjects(r.Context(), r.URL.Path, &q)
if err != nil {
return err
}

View File

@ -226,6 +226,6 @@ func (t testBackend) ListCalendarObjects(ctx context.Context, path string, req *
return t.objectMap[path], nil
}
func (t testBackend) QueryCalendarObjects(ctx context.Context, query *CalendarQuery) ([]CalendarObject, error) {
func (t testBackend) QueryCalendarObjects(ctx context.Context, path string, query *CalendarQuery) ([]CalendarObject, error) {
return nil, nil
}