fix: narrowing de posts en Social API
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user