Skip to content

Commit

Permalink
api: update root endpoint to have correct query func (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
worm-emoji authored Sep 26, 2022
1 parent 013c72c commit a9e5ae2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strings"

"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/jackc/pgx/v4"
)

func proofURLToDBQuery(param string) string {
Expand Down Expand Up @@ -53,6 +54,11 @@ func (s *Server) GetRoot(w http.ResponseWriter, r *http.Request) {
roots := make([]hexutil.Bytes, 0)
rb := make(hexutil.Bytes, 0)

_, err := s.db.QueryFunc(ctx, q, []interface{}{dbQuery}, []interface{}{&rb}, func(qfr pgx.QueryFuncRow) error {
roots = append(roots, rb)
return nil
})

if err != nil {
s.sendJSONError(r, w, err, http.StatusInternalServerError, "selecting root")
return
Expand Down

1 comment on commit a9e5ae2

@vercel
Copy link

@vercel vercel bot commented on a9e5ae2 Sep 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lanyard – ./

lanyard.context.wtf
lanyard-git-main.context.wtf
allowlist.context.wtf

Please sign in to comment.