diff --git a/src/app/api/social/route.ts b/src/app/api/social/route.ts index 2d93643..eeac64c 100644 --- a/src/app/api/social/route.ts +++ b/src/app/api/social/route.ts @@ -618,8 +618,8 @@ export async function GET(req: NextRequest) { until ); metrics.facebook = fb; - if (!('error' in fb && fb.error) && Array.isArray(fb.posts)) { - posts.push(...fb.posts); + if ('posts' in fb && Array.isArray(fb.posts)) { + posts.push(...(fb.posts as SocialPost[])); } } if (igInteg?.external_account_id) { @@ -630,8 +630,8 @@ export async function GET(req: NextRequest) { until ); metrics.instagram = ig; - if (!('error' in ig && ig.error) && Array.isArray(ig.posts)) { - posts.push(...ig.posts); + if ('posts' in ig && Array.isArray(ig.posts)) { + posts.push(...(ig.posts as SocialPost[])); } } } catch (e) {