tangled
alpha
login
or
join now
moth11.net
/
88x31
0
fork
atom
tiny 88x31 lexicon for atproto
0
fork
atom
overview
issues
pulls
pipelines
beep
moth11.net
1 month ago
9226aa06
83c5676c
+6
-4
2 changed files
expand all
collapse all
unified
split
db
lexicon.go
handler
button.go
+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
0
0
0
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
}
0
32
btnViews, ncursor, err := h.db.GetButtons(limitI, cursorptr, r.Context())
33
if err != nil {
34
http.Error(w, "error getting buttons!", http.StatusInternalServerError)