Change response sources API

This commit is contained in:
Alexey Khit
2023-09-01 22:27:33 +03:00
parent 22787b979d
commit 0621b82aff
14 changed files with 29 additions and 29 deletions
+2 -2
View File
@@ -220,14 +220,14 @@ type Source struct {
Location string `json:"location,omitempty"`
}
func ResponseSources(w http.ResponseWriter, sources []Source) {
func ResponseSources(w http.ResponseWriter, sources []*Source) {
if len(sources) == 0 {
http.Error(w, "no sources", http.StatusNotFound)
return
}
var response = struct {
Sources []Source `json:"sources"`
Sources []*Source `json:"sources"`
}{
Sources: sources,
}