tiny 88x31 lexicon for atproto

beep

+6 -4
+1 -1
db/lexicon.go
··· 128 return buttons, postedAt, nil 129 } 130 131 - func (s *Store) GetButtons(limit int, cursor *string, ctx context.Context) ([]types.ButtonView, *time.Time, error) { 132 query := ` 133 SELECT 134 uri,
··· 128 return buttons, postedAt, nil 129 } 130 131 + func (s *Store) GetButtons(limit int, cursor *time.Time, ctx context.Context) ([]types.ButtonView, *time.Time, error) { 132 query := ` 133 SELECT 134 uri,
+5 -3
handler/button.go
··· 22 limitI = 1 23 } 24 cursor := r.URL.Query().Get("cursor") 25 - var cursorptr *string 26 if cursor != "" { 27 - cursorptr = &cursor 28 } 29 - 30 btnViews, ncursor, err := h.db.GetButtons(limitI, cursorptr, r.Context()) 31 if err != nil { 32 http.Error(w, "error getting buttons!", http.StatusInternalServerError)
··· 22 limitI = 1 23 } 24 cursor := r.URL.Query().Get("cursor") 25 + var cursorptr *time.Time 26 if cursor != "" { 27 + t, err := time.Parse(time.RFC3339, cursor) 28 + if err == nil { 29 + cursorptr = &t 30 + } 31 } 32 btnViews, ncursor, err := h.db.GetButtons(limitI, cursorptr, r.Context()) 33 if err != nil { 34 http.Error(w, "error getting buttons!", http.StatusInternalServerError)