refactored search movie handler function

This commit is contained in:
andres alcocer
2021-10-07 17:06:06 -04:00
parent 0bbbb9d5f3
commit f6a828e243
6 changed files with 82 additions and 20 deletions

View File

@@ -0,0 +1,11 @@
import { FETCH_SEARCH_MOVIE } from '../actions/index'
export default function (state = {}, action) {
switch (action.type) {
case FETCH_SEARCH_MOVIE:
const data = action.payload.data.results
return { ...state, data }
default:
return state
}
}