feat: toggle watchlist on anime cards with auto reload

This commit is contained in:
2026-04-21 00:43:49 +02:00
parent cd8df7d2bf
commit a950893434
2 changed files with 13 additions and 4 deletions

View File

@@ -172,7 +172,8 @@ func (h *Handler) HandleDeleteWatchlist(w http.ResponseWriter, r *http.Request)
return
}
if r.URL.Query().Get("from") == "watchlist" {
from := r.URL.Query().Get("from")
if from == "watchlist" {
w.WriteHeader(http.StatusOK)
return
}
@@ -183,6 +184,11 @@ func (h *Handler) HandleDeleteWatchlist(w http.ResponseWriter, r *http.Request)
airing = anime.Airing.Bool
}
if from == "card" {
watchlist.CardButton(int(animeID), anime.TitleOriginal, title, "", anime.ImageUrl, airing, false).Render(r.Context(), w)
return
}
watchlist.WatchlistDropdown(int(animeID), anime.TitleOriginal, title, "", anime.ImageUrl, "", airing).Render(r.Context(), w)
}