diff options
Diffstat (limited to 'internal/api')
| -rw-r--r-- | internal/api/api_test.go | 6 | ||||
| -rw-r--r-- | internal/api/photos.go | 7 |
2 files changed, 11 insertions, 2 deletions
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) |