fix: tipado Social al mezclar posts FB/IG
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user