fix: mixed these up, whoopsie
This commit is contained in:
parent
b5f6be0bc6
commit
e45db3b3f2
1 changed files with 2 additions and 2 deletions
4
main.go
4
main.go
|
|
@ -250,7 +250,7 @@ func (h *stopDeparturesHandler) ServeHTTP(w http.ResponseWriter, r *http.Request
|
||||||
conn, err := pool.Acquire(ctx)
|
conn, err := pool.Acquire(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.WriteHeader(500)
|
w.WriteHeader(500)
|
||||||
_ = enc.Encode(RequestError{Code: "0000", Message: "'id' is required"})
|
_ = enc.Encode(RequestError{Code: "0001", Message: "DB Error: " + err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer conn.Release()
|
defer conn.Release()
|
||||||
|
|
@ -261,7 +261,7 @@ func (h *stopDeparturesHandler) ServeHTTP(w http.ResponseWriter, r *http.Request
|
||||||
var stopId = r.PathValue("id")
|
var stopId = r.PathValue("id")
|
||||||
if stopId == "" {
|
if stopId == "" {
|
||||||
w.WriteHeader(400)
|
w.WriteHeader(400)
|
||||||
_ = enc.Encode(RequestError{Code: "0001", Message: "DB Error: " + err.Error()})
|
_ = enc.Encode(RequestError{Code: "0000", Message: "'id' is required"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
stopIdPg := pgtype.Text{String: stopId, Valid: true}
|
stopIdPg := pgtype.Text{String: stopId, Valid: true}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue