From 9237991fa79f9b90a3f14f8b3c42dab25d029f05 Mon Sep 17 00:00:00 2001 From: RanXom Date: Fri, 17 Jul 2026 16:42:21 +0530 Subject: feat(gallery): introduce gallery query --- internal/api/api_test.go | 6 +++++- internal/api/photos.go | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'internal/api') diff --git a/internal/api/api_test.go b/internal/api/api_test.go index dce42e4..cc5a6b0 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -45,7 +45,11 @@ func (f *fakeGalleryService) Reload(ctx context.Context) error { return f.reloadErr } -func (f fakeGalleryService) Gallery(ctx context.Context) ([]gallery.Photo, error) { +func (f fakeGalleryService) Gallery( + ctx context.Context, + query gallery.Query, +) ([]gallery.Photo, error) { + _ = query return f.photos, f.err } diff --git a/internal/api/photos.go b/internal/api/photos.go index ca6b038..1e9db99 100644 --- a/internal/api/photos.go +++ b/internal/api/photos.go @@ -4,13 +4,18 @@ import ( "encoding/json" "log" "net/http" + + "github.com/RanXom/galleryd/internal/gallery" ) func (s *Server) handlePhotos( w http.ResponseWriter, r *http.Request, ) { - photos, err := s.gallery.Gallery(r.Context()) + photos, err := s.gallery.Gallery( + r.Context(), + gallery.Query{}, + ) if err != nil { log.Printf("build gallery: %v", err) -- cgit v1.2.3