tiny 88x31 lexicon for atproto
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add getLikedButtons xrpc endpoint

+22
+21
handler/button.go
··· 51 51 http.Error(w, "error encoding response", http.StatusInternalServerError) 52 52 } 53 53 } 54 + 55 + func (h *Handler) getLikedButtons(w http.ResponseWriter, r *http.Request) { 56 + did := r.URL.Query().Get("did") 57 + cursor := r.URL.Query().Get("cursor") 58 + var crsr *string 59 + if cursor != "" { 60 + crsr = &cursor 61 + } 62 + btns, _, err := h.db.GetUserLikes(did, 50, crsr, r.Context()) 63 + if err != nil { 64 + log.Println(err) 65 + http.Error(w, "error", http.StatusInternalServerError) 66 + return 67 + } 68 + encoder := json.NewEncoder(w) 69 + err = encoder.Encode(btns) 70 + if err != nil { 71 + log.Println(err) 72 + http.Error(w, "encoding error", http.StatusInternalServerError) 73 + } 74 + }
+1
handler/handler.go
··· 56 56 mux.HandleFunc("GET /button", h.oauthMiddleware(h.getbutton)) 57 57 mux.HandleFunc("GET /xrpc/store.88x31.getButton", h.WithCORS(h.getButton)) 58 58 mux.HandleFunc("GET /xrpc/store.88x31.getButtons", h.WithCORS(h.getButtons)) 59 + mux.HandleFunc("GET /xrpc/store.88x31.getLikedButtons", h.WithCORS(h.getLikedButtons)) 59 60 mux.HandleFunc("GET /embed/liked-by", h.WithCORS(h.getuserlikes)) 60 61 mux.HandleFunc(oauthCallbackPath(), h.oauthCallback) 61 62 mux.HandleFunc(clientMetadataPath(), h.WithCORS(h.serveClientMetadata))