aboutsummaryrefslogtreecommitdiff
path: root/internal/api/reload.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/reload.go')
-rw-r--r--internal/api/reload.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/internal/api/reload.go b/internal/api/reload.go
new file mode 100644
index 0000000..bd3cffb
--- /dev/null
+++ b/internal/api/reload.go
@@ -0,0 +1,25 @@
+package api
+
+import (
+ "log"
+ "net/http"
+)
+
+func (s *Server) handleReload(
+ w http.ResponseWriter,
+ r *http.Request,
+) {
+ if err := s.gallery.Reload(r.Context()); err != nil {
+ log.Printf("reload gallery: %v", err)
+
+ writeError(
+ w,
+ http.StatusInternalServerError,
+ "failed to reload gallery",
+ )
+
+ return
+ }
+
+ w.WriteHeader(http.StatusNoContent)
+}