From 31e9e14063738abe1dd71ed0a8bd95a241a3ddc7 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Wed, 1 Sep 2021 22:17:09 +0400 Subject: [PATCH] Quick fix to get first element of an array after a promise is resolved. --- radio/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/index.js b/radio/index.js index aa61b61..793a317 100644 --- a/radio/index.js +++ b/radio/index.js @@ -70,7 +70,7 @@ function setRoutes() { ctx.body = await getRadioStatus(); }) .get('/lastsong', async ctx => { - ctx.body = await getLastPlayedSongs(2)[0]; + ctx.body = (await getLastPlayedSongs(2))[0]; }); }