diff --git a/assets/views/fragments/artwork.jet.html b/assets/views/fragments/artwork.jet.html
index 3948c88..935134c 100644
--- a/assets/views/fragments/artwork.jet.html
+++ b/assets/views/fragments/artwork.jet.html
@@ -61,25 +61,29 @@
+
{{- if isset(.BookmarkData) && LoggedIn }}
-
+
{{- if .Liked && LoggedIn}}
Liked
{{- else }}
-
+
Like
{{- end }}
+
diff --git a/server/middleware/router.go b/server/middleware/router.go
index 6b73261..5077c5e 100644
--- a/server/middleware/router.go
+++ b/server/middleware/router.go
@@ -113,9 +113,9 @@ func DefineRoutes() *mux.Router {
router.HandleFunc("/self", CatchError(routes.LoginUserPage)).Methods("GET")
router.HandleFunc("/self/followingWorks", CatchError(routes.FollowingWorksPage)).Methods("GET")
router.HandleFunc("/self/bookmarks", CatchError(routes.LoginBookmarkPage)).Methods("GET")
- router.HandleFunc("/self/addBookmark/{id}", CatchError(routes.AddBookmarkRoute)).Methods("GET")
- router.HandleFunc("/self/deleteBookmark/{id}", CatchError(routes.DeleteBookmarkRoute)).Methods("GET")
- router.HandleFunc("/self/like/{id}", CatchError(routes.LikeRoute)).Methods("GET")
+ router.HandleFunc("/self/addBookmark/{id}", CatchError(routes.AddBookmarkRoute)).Methods("POST")
+ router.HandleFunc("/self/deleteBookmark/{id}", CatchError(routes.DeleteBookmarkRoute)).Methods("POST")
+ router.HandleFunc("/self/like/{id}", CatchError(routes.LikeRoute)).Methods("POST")
// oEmbed endpoint for embedding Pixiv content
router.HandleFunc("/oembed", CatchError(routes.Oembed)).Methods("GET")
diff --git a/server/routes/actions.go b/server/routes/actions.go
index 30d9392..80e798b 100644
--- a/server/routes/actions.go
+++ b/server/routes/actions.go
@@ -34,6 +34,14 @@ func AddBookmarkRoute(w http.ResponseWriter, r *http.Request) error {
return err
}
+ if r.Header.Get("HX-Request") == "true" {
+ w.Header().Set("Content-Type", "text/html")
+ fmt.Fprintf(w, `