From f19b7a59acae9f075a1219aeb99ec65c9aff09c0 Mon Sep 17 00:00:00 2001 From: Akuoko Daniel Jnr Date: Tue, 15 Sep 2020 19:28:50 +0000 Subject: [PATCH] fix: deeplink slate query bug --- pages/api/search/slates/[query].js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/api/search/slates/[query].js b/pages/api/search/slates/[query].js index a7f94f62..da2d5976 100644 --- a/pages/api/search/slates/[query].js +++ b/pages/api/search/slates/[query].js @@ -15,7 +15,7 @@ export default async (req, res) => { if (req.body.data.deeplink) { if (slates.length) { - const slate = { ...slates[0] }; + const slate = slates.filter((item) => item.slatename === query)[0]; const user = await Data.getUserById({ id: slate.data.ownerId }); slate.user = Serializers.user(user);