Skip to content

Commit

Permalink
'modificacion slice.js'
Browse files Browse the repository at this point in the history
  • Loading branch information
ErickSalazar44 committed Sep 19, 2023
1 parent ed18140 commit ee2e0c3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/store/slices/genresSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import axios from "axios";
export const fetchGenres = createAsyncThunk(
"genres/fetchGenres",
async (ismovie) => {
const apiKey = "617b8b681bdb0227b53464f2d357d8e1";
const headers = {
Accept: "application/json",
Authorization: `Bearer ${import.meta.env.VITE_API_URL}`,
};

const response = await axios.get(
`https://api.themoviedb.org/3/genre/${ismovie}/list?language=es-ES&api_key=${apiKey}`
);
const url = `https://api.themoviedb.org/3/genre/${ismovie}/list?language=es-ES&locale=US`;
const response = await axios.get(url, { headers });
return response.data.genres;
}
);
Expand Down

0 comments on commit ee2e0c3

Please sign in to comment.