From 9f30aa68209354149ce2cef46587aecf7e86bdc2 Mon Sep 17 00:00:00 2001 From: 4Ventures <4ventures@MacBook-Air-de-4Ventures.local> Date: Thu, 24 Sep 2026 17:31:36 +0200 Subject: [PATCH] fix: narrowing de posts en Social API Co-authored-by: Cursor --- src/app/api/social/route.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) {