From 7370eec20391432e25c9a8f53101b10153767aa5 Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 4 Mar 2024 20:12:53 +0300 Subject: [PATCH] get-shout-data-fix-2 --- index.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.mjs b/index.mjs index 9291924..64775a9 100644 --- a/index.mjs +++ b/index.mjs @@ -75,7 +75,8 @@ const server = Server.configure({ get_shout(shout_id: ${shout_id}) { id slug - authors + created_by + authors { id } } } ` @@ -84,8 +85,8 @@ const server = Server.configure({ .then(res => res.json()) .then(({ data }) => { console.debug('shout data:', data) - const { authors } = data.get_shout; - if (authors.includes(author_id)) { + const { authors, created_by } = data.get_shout; + if (authors.some(author => author.id === author_id) || created_by === author_id) { return resolve({ id: user_id, author: author_id,