mirror of
https://gitlab.com/foxixus/neomovies-api.git
synced 2025-12-16 20:46:10 +05:00
Add 'api/v1/tv/top-rated' route'
This commit is contained in:
@@ -150,24 +150,6 @@ func (h *MovieHandler) Upcoming(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
func (h *MovieHandler) NowPlaying(w http.ResponseWriter, r *http.Request) {
|
||||
page := getIntQuery(r, "page", 1)
|
||||
language := GetLanguage(r)
|
||||
region := r.URL.Query().Get("region")
|
||||
|
||||
movies, err := h.movieService.GetNowPlaying(page, language, region)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(models.APIResponse{
|
||||
Success: true,
|
||||
Data: movies,
|
||||
})
|
||||
}
|
||||
|
||||
func (h *MovieHandler) GetRecommendations(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
id, err := strconv.Atoi(vars["id"])
|
||||
|
||||
Reference in New Issue
Block a user