Rewrote account switching, fix some minor bugs here and there

This commit is contained in:
Mukhtar Akere
2025-09-16 21:15:24 +01:00
parent 76f5b85313
commit 30b2db06e7
34 changed files with 945 additions and 866 deletions

View File

@@ -3,9 +3,10 @@ package web
import (
"encoding/json"
"fmt"
"github.com/sirrobot01/decypharr/internal/config"
"net/http"
"strings"
"github.com/sirrobot01/decypharr/internal/config"
)
func (wb *Web) setupMiddleware(next http.Handler) http.Handler {
@@ -79,7 +80,7 @@ func (wb *Web) sendJSONError(w http.ResponseWriter, message string, statusCode i
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(statusCode)
json.NewEncoder(w).Encode(map[string]interface{}{
"error": message,
"status": statusCode,
"error": message,
"status": statusCode,
})
}
}