get-shout-data-fix

This commit is contained in:
Untone 2024-03-04 20:05:20 +03:00
parent 6a815490bb
commit 7f4c5dc20f

View File

@ -72,18 +72,17 @@ const server = Server.configure({
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ body: JSON.stringify({
query: `query { query: `query {
get_shout(shout_id: $shout_id) { get_shout(shout_id: ${shout_id}) {
id id
slug slug
authors authors
} }
} }
`, `
variables: { shout_id },
}), }),
}) })
.then(res => res.json()) .then(res => res.json())
.then((data) => { .then(({ data }) => {
console.debug('shout data:', data) console.debug('shout data:', data)
const { authors } = data.get_shout; const { authors } = data.get_shout;
if (authors.includes(author_id)) { if (authors.includes(author_id)) {