fix: mixed these up, whoopsie

This commit is contained in:
etwas 2025-04-15 21:50:22 +02:00
parent b5f6be0bc6
commit e45db3b3f2
Signed by: etwas
SSH key fingerprint: SHA256:bHhIeAdn/2k9jmOs6+u6ox98VYmoHUN3HfnpV2w8Ws0

View file

@ -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}