From 065b1dff0b2276908df643df71b007a6a277cde4 Mon Sep 17 00:00:00 2001 From: capitanwesler Date: Mon, 15 Mar 2021 16:24:45 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=86=99Missing=20prop=20of=20directory=20c?= =?UTF-8?q?ontroller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/AnimeController.ts | 4 ++-- src/controllers/DirectoryController.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/controllers/AnimeController.ts b/src/controllers/AnimeController.ts index 3e0f6bb..206edf0 100644 --- a/src/controllers/AnimeController.ts +++ b/src/controllers/AnimeController.ts @@ -298,7 +298,7 @@ export default class AnimeController { type: animeQuery[0].type || null, rating: animeQuery[0].score || null, genres: animeQuery[0].genres || null, - moreInfo: await animeExtraInfo(animeQuery[0].mal_id), + moreInfo: [await animeExtraInfo(animeQuery[0].mal_id)], promo: await getAnimeVideoPromo(animeQuery[0].mal_id), characters: await getAnimeCharacters(animeQuery[0].mal_id), related: await getRelatedAnimesFLV(animeQuery[0].id), @@ -312,7 +312,7 @@ export default class AnimeController { type: animeQuery[0].type || null, rating: animeQuery[0].score || null, genres: animeQuery[0].genres || null, - moreInfo: await animeExtraInfo(animeQuery[0].mal_id), + moreInfo: [await animeExtraInfo(animeQuery[0].mal_id)], promo: await getAnimeVideoPromo(animeQuery[0].mal_id), characters: await getAnimeCharacters(animeQuery[0].mal_id), related: await getRelatedAnimesMAL(animeQuery[0].mal_id), diff --git a/src/controllers/DirectoryController.ts b/src/controllers/DirectoryController.ts index 1409888..d842838 100644 --- a/src/controllers/DirectoryController.ts +++ b/src/controllers/DirectoryController.ts @@ -283,7 +283,7 @@ export default class DirectoryController { return next(err); } - const result: any[] = resultReq.animes.map((item: any) => { + const animes: any[] = resultReq.animes.map((item: any) => { return { id: item.id, title: item.title.trim(), @@ -298,8 +298,8 @@ export default class DirectoryController { }; }); - if (result.length > 0) { - res.status(200).json({ result }); + if (animes.length > 0) { + res.status(200).json({ animes }); } else { res.status(500).json({ message: 'Aruppi lost in the shell' }); }