Fixed formatting issues
Some checks failed
Tests / Run Tests (1.23.x) (push) Has been cancelled
Tests / Run Tests (1.24.x) (push) Has been cancelled
Tests / Lint Code (push) Has been cancelled
Tests / Build (push) Has been cancelled

This commit is contained in:
Hein
2025-12-01 14:56:30 +02:00
parent 1643a5e920
commit 78029fb34f
10 changed files with 77 additions and 64 deletions

View File

@@ -18,9 +18,9 @@ type RequestParameters struct {
Distinct bool
// Filtering
FieldFilters map[string]string // column -> value (exact match)
SearchFilters map[string]string // column -> value (ILIKE)
SearchOps map[string]FilterOperator // column -> {operator, value, logic}
FieldFilters map[string]string // column -> value (exact match)
SearchFilters map[string]string // column -> value (ILIKE)
SearchOps map[string]FilterOperator // column -> {operator, value, logic}
CustomSQLWhere string
CustomSQLOr string
@@ -51,10 +51,10 @@ func (h *Handler) ParseParameters(r *http.Request) *RequestParameters {
FieldFilters: make(map[string]string),
SearchFilters: make(map[string]string),
SearchOps: make(map[string]FilterOperator),
Limit: 20, // Default limit
Offset: 0, // Default offset
Limit: 20, // Default limit
Offset: 0, // Default offset
ResponseFormat: "simple", // Default format
ComplexAPI: false, // Default to simple API
ComplexAPI: false, // Default to simple API
}
// Merge headers and query parameters
@@ -155,7 +155,7 @@ func (h *Handler) ParseParameters(r *http.Request) *RequestParameters {
// Response Format
case strings.HasPrefix(key, "x-simpleapi"):
params.ResponseFormat = "simple"
params.ComplexAPI = !(decodedValue == "1" || strings.EqualFold(decodedValue, "true"))
params.ComplexAPI = decodedValue != "1" && !strings.EqualFold(decodedValue, "true")
case strings.HasPrefix(key, "x-detailapi"):
params.ResponseFormat = "detail"
params.ComplexAPI = true