fix: narrowing de posts en Social API

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
4Ventures
2026-09-24 17:31:36 +02:00
parent b0d19e4da5
commit 9f30aa6820

View File

@@ -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) {