mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-10 01:42:55 +00:00
minor fix
This commit is contained in:
@@ -149,21 +149,7 @@ func HandleSensorByLocationYear(w http.ResponseWriter, r *http.Request, ps httpr
|
|||||||
|
|
||||||
s, err := daily_sensor.GetAllSensorInfoByYear(location, year)
|
s, err := daily_sensor.GetAllSensorInfoByYear(location, year)
|
||||||
|
|
||||||
var response string
|
response := createResponse(s, err)
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Println(err)
|
|
||||||
response = "{message : \"Error loading data from database\""
|
|
||||||
} else {
|
|
||||||
js, err := json.MarshalIndent(s, "", " ")
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Println(err)
|
|
||||||
response = "{message : \"Error loading data from database\""
|
|
||||||
} else {
|
|
||||||
response = string(js)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Fprint(w, response)
|
fmt.Fprint(w, response)
|
||||||
}
|
}
|
||||||
@@ -178,21 +164,7 @@ func HandleSensorByLocationMonth(w http.ResponseWriter, r *http.Request, ps http
|
|||||||
|
|
||||||
s, err := daily_sensor.GetAllSensorInfoByMonth(location, year, monthname)
|
s, err := daily_sensor.GetAllSensorInfoByMonth(location, year, monthname)
|
||||||
|
|
||||||
var response string
|
response := createResponse(s, err)
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Println(err)
|
|
||||||
response = "{message : \"Error loading data from database\""
|
|
||||||
} else {
|
|
||||||
js, err := json.MarshalIndent(s, "", " ")
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Println(err)
|
|
||||||
response = "{message : \"Error loading data from database\""
|
|
||||||
} else {
|
|
||||||
response = string(js)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Fprint(w, response)
|
fmt.Fprint(w, response)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user