Skip to content

Commit

Permalink
fix: set Values type in LocationContext to map
Browse files Browse the repository at this point in the history
I'm not actually sure what the exact type is. However,
`django-htmx` sets the values parameter type to a `dict[str, str]`.
It only makes sense that I should turn `Values` into `map[string]string`.

Reference: https://django-htmx.readthedocs.io/en/latest/http.html#django_htmx.http.HttpResponseLocation
  • Loading branch information
angelofallars committed Nov 24, 2023
1 parent 95418db commit 435fe75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions respheaders.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ type LocationContext struct {
// How the response will be swapped in relative to the target.
Swap swapper
// Values to submit with the request.
Values []string
Values map[string]string
// Headers to submit with the request
Headers map[string]string
// Allows you to select the content you want swapped from a response.
Expand All @@ -124,7 +124,7 @@ type locationContext struct {
Handler string `json:"handler,omitempty"`
Target string `json:"target,omitempty"`
Swap swapper `json:"swap,omitempty"`
Values []string `json:"values,omitempty"`
Values map[string]string `json:"values,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Select string `json:"select,omitempty"`
}
Expand Down

0 comments on commit 435fe75

Please sign in to comment.