Skip to content

Commit

Permalink
fix bug with season 5 episode
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladrillo committed Dec 12, 2022
1 parent b3e1232 commit af46598
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/api/fetchShow.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import stripTags from 'striptags';

const formatSeasons = (allEpisodes) => {
const seasons = [
{id:0, name: "Season 1", episodes: []},
{id:1, name: "Season 2", episodes: []},
{id:2, name: "Season 3", episodes: []},
{id:3, name: "Season 4", episodes: []}
{id:0, name: "Season 1", episodes: []},
{id:1, name: "Season 2", episodes: []},
{id:2, name: "Season 3", episodes: []},
{id:3, name: "Season 4", episodes: []},
{id:4, name: "Season 5", episodes: []},
];

allEpisodes.forEach((episode) => {
Expand All @@ -26,7 +27,7 @@ const fetchShow = () => {
.get("https://api.tvmaze.com/singlesearch/shows?q=stranger+things&embed=episodes")
.then(res => {
const { data } = res;

return {
name: data.name,
image: data.image,
Expand Down

0 comments on commit af46598

Please sign in to comment.