From dabc7f6c23f57becfe00a5d811f0aca56664f992 Mon Sep 17 00:00:00 2001 From: capitanwesler Date: Sat, 3 Apr 2021 19:29:15 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=80=20Fixing=20changed=20body=20respon?= =?UTF-8?q?se?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/util.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/utils/util.ts b/src/utils/util.ts index 798b67c..106f1f3 100644 --- a/src/utils/util.ts +++ b/src/utils/util.ts @@ -16,8 +16,8 @@ redisClient.get = util.promisify(redisClient.get); interface Promo { title: string; - previewImage: string; - videoUrl: string; + image_url: string; + video_url: string; } interface Character { @@ -143,7 +143,13 @@ export const getAnimeVideoPromo = async (mal_id: number) => { return err; } - const promo: Promo[] = data.promo.map((item: Promo) => item); + const promo: Promo[] = data.promo.map((item: Promo) => { + return { + title: item.title, + previewImage: item.image_url, + videoURL: item.video_url, + }; + }); if (promo.length > 0) { /* Set the key in the redis cache. */