aboutsummaryrefslogtreecommitdiff
path: root/service/transport.go
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2019-12-26 09:11:24 +0000
committerr <r@freesoftwareextremist.com>2019-12-26 09:44:05 +0000
commitac4ff88adb9a2526555757f8d4e65c69cafb3788 (patch)
tree9277e726f3c152aa72c01167744ba9465ded4cbd /service/transport.go
parentc34bde2d52bf71ff7de7d92f659e820fe4ea315b (diff)
downloadbloat-ac4ff88adb9a2526555757f8d4e65c69cafb3788.tar.gz
bloat-ac4ff88adb9a2526555757f8d4e65c69cafb3788.zip
Add liked by and retweeted by page
Diffstat (limited to 'service/transport.go')
-rw-r--r--service/transport.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/service/transport.go b/service/transport.go
index 438b39d..d4011db 100644
--- a/service/transport.go
+++ b/service/transport.go
@@ -98,6 +98,28 @@ func NewHandler(s Service, staticDir string) http.Handler {
}
}).Methods(http.MethodGet)
+ r.HandleFunc("/likedby/{id}", func(w http.ResponseWriter, req *http.Request) {
+ ctx := getContextWithSession(context.Background(), req)
+ id, _ := mux.Vars(req)["id"]
+
+ err := s.ServeLikedByPage(ctx, w, nil, id)
+ if err != nil {
+ s.ServeErrorPage(ctx, w, err)
+ return
+ }
+ }).Methods(http.MethodGet)
+
+ r.HandleFunc("/retweetedby/{id}", func(w http.ResponseWriter, req *http.Request) {
+ ctx := getContextWithSession(context.Background(), req)
+ id, _ := mux.Vars(req)["id"]
+
+ err := s.ServeRetweetedByPage(ctx, w, nil, id)
+ if err != nil {
+ s.ServeErrorPage(ctx, w, err)
+ return
+ }
+ }).Methods(http.MethodGet)
+
r.HandleFunc("/like/{id}", func(w http.ResponseWriter, req *http.Request) {
ctx := getContextWithSession(context.Background(), req)
id, _ := mux.Vars(req)["id"]