From b0d19e4da557204a45f351363f57aad06907a3c5 Mon Sep 17 00:00:00 2001 From: 4Ventures <4ventures@MacBook-Air-de-4Ventures.local> Date: Thu, 24 Sep 2026 17:31:02 +0200 Subject: [PATCH] fix: tipado Social al mezclar posts FB/IG Co-authored-by: Cursor --- src/app/api/social/route.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/api/social/route.ts b/src/app/api/social/route.ts index 1bb06b9..2d93643 100644 --- a/src/app/api/social/route.ts +++ b/src/app/api/social/route.ts @@ -618,7 +618,9 @@ export async function GET(req: NextRequest) { until ); metrics.facebook = fb; - if (Array.isArray(fb.posts)) posts.push(...fb.posts); + if (!('error' in fb && fb.error) && Array.isArray(fb.posts)) { + posts.push(...fb.posts); + } } if (igInteg?.external_account_id) { const ig = await fetchIgBundle( @@ -628,7 +630,9 @@ export async function GET(req: NextRequest) { until ); metrics.instagram = ig; - if (Array.isArray(ig.posts)) posts.push(...ig.posts); + if (!('error' in ig && ig.error) && Array.isArray(ig.posts)) { + posts.push(...ig.posts); + } } } catch (e) { metrics.warning = e instanceof Error ? e.message : 'metrics error';