refactored reducers

This commit is contained in:
andres alcocer
2021-10-08 18:39:42 -04:00
parent 09318b3134
commit 4a82c29a7b
6 changed files with 11 additions and 50 deletions

View File

@@ -1,6 +1,5 @@
import axios from '../../axios-movies'
export const FETCH_HEADER_MOVIE = 'FETCH_HEADER_MOVIE'
export const FETCH_TRENDING = 'FETCH_TRENDING'
export const FETCH_NETFLIX_ORIGINALS = 'FETCH_NETFLIX_ORIGINALS'
export const FETCH_TOP_RATED = 'FETCH_TOP_RATED'
@@ -57,21 +56,6 @@ export const fetchSearchMovie = (searchTerm) => {
}
}
export const fetchHeaderMovie = () => {
const movieId = 63351
return async (dispatch) => {
try {
const request = await axios.get(
`tv/${movieId}?api_key=${process.env.API_KEY}`
)
dispatch({ type: FETCH_HEADER_MOVIE, payload: request })
} catch (error) {
console.log('error', error)
}
}
}
export const fetchNetflixOriginals = () => {
return async (dispatch) => {
try {