From 7707fc683ad6ae801aa69330789c829480be47f5 Mon Sep 17 00:00:00 2001 From: Sujoy De <99689289+desujoy@users.noreply.github.com> Date: Sat, 7 Oct 2023 22:32:09 +0530 Subject: [PATCH] fix genres --- index.js | 4 ++-- views/index.ejs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 2c5e8a3..aeec4ed 100644 --- a/index.js +++ b/index.js @@ -32,11 +32,11 @@ app.get("/", async (req, res) => { const random = Math.floor(Math.random() * list.length); const response = await axios.get(MAL_URL + 'anime/' + list[random].id + MAL_FIELDS, MAL_HEADER); const data = response.data; - console.log(data); + const genres = data.genres.map((genre) => genre.name); const anime = { title: data.title, poster: data.main_picture.large, - genre: data.genres[0].name, + genre: genres, synopsis: data.synopsis, rating: data.mean, status: data.status, diff --git a/views/index.ejs b/views/index.ejs index 8200f0c..e8c75d7 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -47,6 +47,7 @@