From f4c947b89a1cb6150e832f79ea4b516c14796218 Mon Sep 17 00:00:00 2001 From: Santosh Bhandari Date: Mon, 4 May 2026 23:59:44 +0545 Subject: [PATCH] fix: update tiktok provider to properly use this.fetch This is to ensure that handleErrors is properly triggered whenever there is issue --- .../src/integrations/social/tiktok.provider.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/nestjs-libraries/src/integrations/social/tiktok.provider.ts b/libraries/nestjs-libraries/src/integrations/social/tiktok.provider.ts index b3b042db..6b52d5d5 100644 --- a/libraries/nestjs-libraries/src/integrations/social/tiktok.provider.ts +++ b/libraries/nestjs-libraries/src/integrations/social/tiktok.provider.ts @@ -246,7 +246,7 @@ export class TiktokProvider extends SocialAbstract implements SocialProvider { }; const { access_token, refresh_token, ...all } = await ( - await fetch('https://open.tiktokapis.com/v2/oauth/token/', { + await this.fetch('https://open.tiktokapis.com/v2/oauth/token/', { headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, @@ -260,7 +260,7 @@ export class TiktokProvider extends SocialAbstract implements SocialProvider { user: { avatar_url, display_name, open_id, username }, }, } = await ( - await fetch( + await this.fetch( 'https://open.tiktokapis.com/v2/user/info/?fields=open_id,avatar_url,display_name,union_id,username', { method: 'GET', @@ -323,7 +323,7 @@ export class TiktokProvider extends SocialAbstract implements SocialProvider { }; const { access_token, refresh_token, scope } = await ( - await fetch('https://open.tiktokapis.com/v2/oauth/token/', { + await this.fetch('https://open.tiktokapis.com/v2/oauth/token/', { headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, @@ -339,7 +339,7 @@ export class TiktokProvider extends SocialAbstract implements SocialProvider { user: { avatar_url, display_name, open_id, username }, }, } = await ( - await fetch( + await this.fetch( 'https://open.tiktokapis.com/v2/user/info/?fields=open_id,avatar_url,display_name,union_id,username', { method: 'GET', @@ -365,7 +365,7 @@ export class TiktokProvider extends SocialAbstract implements SocialProvider { const { data: { max_video_post_duration_sec }, } = await ( - await fetch( + await this.fetch( 'https://open.tiktokapis.com/v2/post/publish/creator_info/query/', { method: 'POST',