tiny 88x31 lexicon for atproto

beep

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