diff --git a/src/lib/api.js b/src/lib/api.js index 372bd49..930b784 100644 --- a/src/lib/api.js +++ b/src/lib/api.js @@ -192,7 +192,9 @@ export async function getPost(host, token, post_id) { const data = await fetch(url, { method: 'GET', headers: { "Authorization": token ? `Bearer ${token}` : null } - }).then(res => res.json()); + }).then(res => res.json()) + + if (!data || data.error) return false; return data; } @@ -358,4 +360,4 @@ export async function getUser(host, token, user_id) { }).then(res => res.json()); return data; -} \ No newline at end of file +}