import 'whatwg-fetch'
import { API_URL, API_KEY } from '../config'
import types from '../constants/actionTypes'

const fetchGenres = () => {
  const apiUrl = API_URL
  const apiKey = API_KEY

  let api_endpoint = `${apiUrl}/genre/movie/list?api_key=${apiKey}`

  return {
    type: types.FETCH_GENRES,
    payload: new Promise((resolve, reject) => {
      fetch(api_endpoint).then(r => resolve(r.json())).catch(reject)
    })
  }
}

export { fetchGenres }

@@ -146,57 +146,8 @@
 nst 
-apiUrl = API_URL%0A  const apiKey = API_KEY%0A%0A  let 
 api_
@@ -164,14 +164,15 @@
  %60$%7B
-apiUrl
+API_URL
 %7D/ge
@@ -200,14 +200,15 @@
 y=$%7B
-apiKey
+API_KEY
 %7D%60%0A%0A

Update genres.js