Updating server
This commit is contained in:
parent
018033466b
commit
1b3d9308e1
@ -336,7 +336,7 @@ func handleAccessReview(rw http.ResponseWriter, req *http.Request) {
|
||||
}
|
||||
|
||||
if rowsAffected == 0 || len(request.Profile) == 0 {
|
||||
http.Error(rw, err.Error(), http.StatusInternalServerError)
|
||||
http.Error(rw, "invalid profile", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
|
2
types.go
2
types.go
@ -62,7 +62,7 @@ type record struct {
|
||||
Id int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Score float64 `json:"score"`
|
||||
Url string `json:"url"`
|
||||
Urls string `json:"urls"`
|
||||
features map[string]float64
|
||||
geo geoData
|
||||
}
|
||||
|
8
util.go
8
util.go
@ -256,7 +256,7 @@ func computeRecordCompat(db *sql.DB, entries []record, context queryContext) err
|
||||
}
|
||||
|
||||
func fetchRecords(db *sql.DB, context queryContext) ([]record, error) {
|
||||
rows, err := db.Query("SELECT name, url, delicious, accommodating, affordable, atmospheric, latitude, longitude, closestStnDist, closestStnName, accessCount, id FROM reviews")
|
||||
rows, err := db.Query("SELECT name, urls, delicious, accommodating, affordable, atmospheric, latitude, longitude, closestStnDist, closestStnName, accessCount, id FROM reviews")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -265,7 +265,7 @@ func fetchRecords(db *sql.DB, context queryContext) ([]record, error) {
|
||||
var entries []record
|
||||
for rows.Next() {
|
||||
var (
|
||||
name, url, closestStn string
|
||||
name, urls, closestStn string
|
||||
delicious, accommodating, affordable, atmospheric float64
|
||||
latitude, longitude, distanceToStn float64
|
||||
accessCount, id int
|
||||
@ -273,7 +273,7 @@ func fetchRecords(db *sql.DB, context queryContext) ([]record, error) {
|
||||
|
||||
rows.Scan(
|
||||
&name,
|
||||
&url,
|
||||
&urls,
|
||||
&delicious,
|
||||
&accommodating,
|
||||
&affordable,
|
||||
@ -287,7 +287,7 @@ func fetchRecords(db *sql.DB, context queryContext) ([]record, error) {
|
||||
|
||||
entry := record{
|
||||
Name: name,
|
||||
Url: url,
|
||||
Urls: urls,
|
||||
DistanceToStn: distanceToStn,
|
||||
ClosestStn: closestStn,
|
||||
AccessCount: accessCount,
|
||||
|
Loading…
Reference in New Issue
Block a user