fix(admin): cascade base_url to opds/api URLs, fix pending registration time format

- UpdateSystemConfiguration: when base_url changes, automatically
  update opds_base_url and api_base_url derived configs
- convertPending: format time.Time as RFC3339 string instead of
  relying on string type assertion which would panic
This commit is contained in:
john-okeefe committed 2026-06-02 19:45:39 -04:00
1 parent 5d22021e8e
commit 1f8c3c21ae
2 files changed
+21 -1

No files matched your search

+2 -1
View File
@@ -4,6 +4,7 @@ import (
"context"
"log"
"net/url"
"time"
"bookhoard/internal/database"
"bookhoard/templates"
@@ -66,7 +67,7 @@ func convertPending(pending []map[string]interface{}) []templates.PendingRegistr
RegistrationID: p["registration_id"].(string),
DeviceName: p["device_name"].(string),
DeviceType: p["device_type"].(string),
ExpiresAt: p["expires_at"].(string),
ExpiresAt: p["expires_at"].(time.Time).Format(time.RFC3339),
}
}
return result