Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenraad Verheyden committed Sep 12, 2023
1 parent 14ee05c commit e3e12fd
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions modules/overrides/userconfigurable/api/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,8 @@ const (
errNoIfMatchHeader = "must specify If-Match header"

queryParamScope = "scope"
)

type Scope string

const (
SCOPE_API Scope = "api"
SCOPE_MERGED Scope = "merged"
scopeApi = "api"
scopeMerged = "merged"
)

// GetHandler retrieves the user-configured overrides from the backend.
Expand All @@ -49,19 +44,19 @@ func (a *UserConfigOverridesAPI) GetHandler(w http.ResponseWriter, r *http.Reque
return
}

scope := SCOPE_API
scope := scopeApi
if value, ok := r.URL.Query()[queryParamScope]; ok {
scope = Scope(value[0])
scope = value[0]
}

if scope == SCOPE_API {
if scope == scopeApi {
limits, version, err := a.get(ctx, userID)
if err != nil {
writeError(w, err)
return
}
err = writeLimits(w, limits, version)
} else if scope == SCOPE_MERGED {
} else if scope == scopeMerged {
// TODO we don't have a version since we don't do a backend call
version := backend.Version("")

Expand Down

0 comments on commit e3e12fd

Please sign in to comment.