fix: list permanent whitelist entries sorted by creation time
Update ListPermEntries to return entry field instead of ip and sort results by created_at. Update the handler in auth.go to call ListPermEntries instead of ListTempEntries for the whitelist endpoint.
This commit is contained in:
2
auth.go
2
auth.go
@@ -76,7 +76,7 @@ func whitelistListHandler(cfg Config, db *sql.DB) http.HandlerFunc {
|
||||
http.Error(w, "unauthorized", http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
entries, err := ListTempEntries(db)
|
||||
entries, err := ListPermEntries(db)
|
||||
if err != nil {
|
||||
http.Error(w, "database error", http.StatusInternalServerError)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user