feat: toggle watchlist on anime cards with auto reload
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user