mirror of
https://gitlab.com/foxixus/neomovies-api.git
synced 2025-12-18 13:36:09 +05:00
upd favorites
This commit is contained in:
@@ -14,8 +14,9 @@ import (
|
||||
)
|
||||
|
||||
type FavoritesService struct {
|
||||
db *mongo.Database
|
||||
tmdb *TMDBService
|
||||
db *mongo.Database
|
||||
tmdb *TMDBService
|
||||
kinopoisk *KinopoiskService
|
||||
}
|
||||
|
||||
func NewFavoritesService(db *mongo.Database, tmdb *TMDBService) *FavoritesService {
|
||||
@@ -25,6 +26,14 @@ func NewFavoritesService(db *mongo.Database, tmdb *TMDBService) *FavoritesServic
|
||||
}
|
||||
}
|
||||
|
||||
func NewFavoritesServiceWithKP(db *mongo.Database, tmdb *TMDBService, kp *KinopoiskService) *FavoritesService {
|
||||
return &FavoritesService{
|
||||
db: db,
|
||||
tmdb: tmdb,
|
||||
kinopoisk: kp,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *FavoritesService) AddToFavorites(userID, mediaID, mediaType string) error {
|
||||
collection := s.db.Collection("favorites")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user