fix: pass watchlist status to anime detail page
Anime detail page never looked up or passed the user's watchlist status, so the dropdown always showed 'Add to Watchlist'. Now queries watch_list_entry and passes Status and WatchlistIDs.
This commit is contained in:
@@ -34,6 +34,10 @@ func (r *watchlistRepository) GetUserWatchList(ctx context.Context, userID strin
|
||||
return r.queries.GetUserWatchList(ctx, userID)
|
||||
}
|
||||
|
||||
func (r *watchlistRepository) GetWatchListEntry(ctx context.Context, arg db.GetWatchListEntryParams) (db.WatchListEntry, error) {
|
||||
return r.queries.GetWatchListEntry(ctx, arg)
|
||||
}
|
||||
|
||||
func (r *watchlistRepository) GetContinueWatchingEntry(ctx context.Context, arg db.GetContinueWatchingEntryParams) (db.ContinueWatchingEntry, error) {
|
||||
return r.queries.GetContinueWatchingEntry(ctx, arg)
|
||||
}
|
||||
|
||||
@@ -55,6 +55,13 @@ func (s *watchlistService) GetWatchlist(ctx context.Context, userID string) ([]d
|
||||
return s.repo.GetUserWatchList(ctx, userID)
|
||||
}
|
||||
|
||||
func (s *watchlistService) GetWatchListEntry(ctx context.Context, userID string, animeID int64) (db.WatchListEntry, error) {
|
||||
return s.repo.GetWatchListEntry(ctx, db.GetWatchListEntryParams{
|
||||
UserID: userID,
|
||||
AnimeID: animeID,
|
||||
})
|
||||
}
|
||||
|
||||
func (s *watchlistService) GetContinueWatchingEntry(ctx context.Context, userID string, animeID int64) (db.ContinueWatchingEntry, error) {
|
||||
return s.repo.GetContinueWatchingEntry(ctx, db.GetContinueWatchingEntryParams{
|
||||
UserID: userID,
|
||||
|
||||
Reference in New Issue
Block a user