This commit is contained in:
6
main.go
6
main.go
@@ -126,6 +126,7 @@ CREATE TABLE IF NOT EXISTS orders (
|
||||
payload JSON NOT NULL,
|
||||
status VARCHAR(20) NOT NULL,
|
||||
finalize_url VARCHAR(255) NOT NULL,
|
||||
cert_url VARCHAR(255) NOT NULL,
|
||||
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS certs (
|
||||
@@ -646,6 +647,7 @@ func (s *server) handleGetOrder(ctx context.Context, w http.ResponseWriter, r *h
|
||||
if err := s.db.db.QueryRowContext(ctx,
|
||||
`SELECT payload,status,finalize_url,cert_url FROM orders WHERE id=?`, id).
|
||||
Scan(&raw, &status, &finalize, &certURL); err != nil {
|
||||
lg.Error("handleGetOrder", err.Error(), "")
|
||||
http.Error(w, "order", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
@@ -660,9 +662,9 @@ func (s *server) handleGetOrder(ctx context.Context, w http.ResponseWriter, r *h
|
||||
}
|
||||
if certURL.Valid {
|
||||
resp.CertURL = certURL.String
|
||||
lg.Info("handleGetOrder", "Step1", "")
|
||||
//lg.Info("handleGetOrder", "Step1", "")
|
||||
}
|
||||
lg.Info("handleGetOrder", "Step2", "")
|
||||
//lg.Info("handleGetOrder", "Step2", "")
|
||||
s.jsonResponse(w, http.StatusOK, resp, "")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user