diff --git a/functions/getForYouFeed/index.ts b/functions/getForYouFeed/index.ts index 5877fd5..d33c44d 100644 --- a/functions/getForYouFeed/index.ts +++ b/functions/getForYouFeed/index.ts @@ -20,7 +20,10 @@ export const onRequestPost: PagesFunction = async (context) => { }, }); - if (!res.ok) throw new Error('Failed to fetch data'); + if (!res.ok) { + console.error(endpoint, res.status, JSON.stringify(res)); + throw new Error('Failed to fetch data'); + } const forYouFeedResponse = (await res.json()) as FeedObject; return new Response(JSON.stringify(forYouFeedResponse)); diff --git a/functions/getReactionsByHash/index.ts b/functions/getReactionsByHash/index.ts index 237b519..744a9a9 100644 --- a/functions/getReactionsByHash/index.ts +++ b/functions/getReactionsByHash/index.ts @@ -21,6 +21,6 @@ export const onRequestPost: PagesFunction = async (context) => { }); if (!res.ok) throw new Error('Failed to fetch data'); - const reactionsResponse: ReactionsByHashResponseSchema = await res.json(); + const reactionsResponse = (await res.json()) as ReactionsByHashResponseSchema; return new Response(JSON.stringify(reactionsResponse)); };