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:
2026-06-02 19:45:39 -04:00
parent 5d22021e8e
commit 1f8c3c21ae
2 changed files with 21 additions and 1 deletions
+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