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
|
until
|
||||||
);
|
);
|
||||||
metrics.facebook = fb;
|
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) {
|
if (igInteg?.external_account_id) {
|
||||||
const ig = await fetchIgBundle(
|
const ig = await fetchIgBundle(
|
||||||
@@ -628,7 +630,9 @@ export async function GET(req: NextRequest) {
|
|||||||
until
|
until
|
||||||
);
|
);
|
||||||
metrics.instagram = ig;
|
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) {
|
} catch (e) {
|
||||||
metrics.warning = e instanceof Error ? e.message : 'metrics error';
|
metrics.warning = e instanceof Error ? e.message : 'metrics error';
|
||||||
|
|||||||
Reference in New Issue
Block a user