From 1a8f6ff6ca444e79d6035ca515cd96451b4fd2fe Mon Sep 17 00:00:00 2001 From: Nevo David Date: Sun, 1 Feb 2026 22:29:41 +0700 Subject: [PATCH] fix: new error for facebook --- .../integrations/social/facebook.provider.ts | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/libraries/nestjs-libraries/src/integrations/social/facebook.provider.ts b/libraries/nestjs-libraries/src/integrations/social/facebook.provider.ts index 6a062af6..ccad72e7 100644 --- a/libraries/nestjs-libraries/src/integrations/social/facebook.provider.ts +++ b/libraries/nestjs-libraries/src/integrations/social/facebook.provider.ts @@ -126,6 +126,13 @@ export class FacebookProvider extends SocialAbstract implements SocialProvider { }; } + if (body.indexOf('1404112') > -1) { + return { + type: 'bad-body' as const, + value: 'For security reasons, your account has limited access to the site for a few days', + }; + } + if (body.indexOf('Name parameter too long') > -1) { return { type: 'bad-body' as const, @@ -504,10 +511,9 @@ export class FacebookProvider extends SocialAbstract implements SocialProvider { case 'post_clicks_by_type': // This returns an object with click types if (typeof value === 'object') { - const totalClicks = Object.values(value as Record).reduce( - (sum: number, v: number) => sum + v, - 0 - ); + const totalClicks = Object.values( + value as Record + ).reduce((sum: number, v: number) => sum + v, 0); label = 'Clicks by Type'; total = String(totalClicks); } @@ -515,10 +521,9 @@ export class FacebookProvider extends SocialAbstract implements SocialProvider { case 'post_reactions_by_type_total': // This returns an object with reaction types if (typeof value === 'object') { - const totalReactions = Object.values(value as Record).reduce( - (sum: number, v: number) => sum + v, - 0 - ); + const totalReactions = Object.values( + value as Record + ).reduce((sum: number, v: number) => sum + v, 0); label = 'Reactions'; total = String(totalReactions); }