Skip to content

Commit 313380e

Browse files
committed
feat: comment to comment
1 parent d6b72a7 commit 313380e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libraries/nestjs-libraries/src/integrations/social/facebook.provider.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,11 @@ export class FacebookProvider extends SocialAbstract implements SocialProvider {
254254
}
255255

256256
const postsArray = [];
257-
for (const comment of comments.reverse()) {
257+
let commentId = finalId;
258+
for (const comment of comments) {
258259
const data = await (
259260
await this.fetch(
260-
`https://graph.facebook.com/v20.0/${finalId}/comments?access_token=${accessToken}&fields=id,permalink_url`,
261+
`https://graph.facebook.com/v20.0/${commentId}/comments?access_token=${accessToken}&fields=id,permalink_url`,
261262
{
262263
method: 'POST',
263264
headers: {
@@ -274,6 +275,7 @@ export class FacebookProvider extends SocialAbstract implements SocialProvider {
274275
)
275276
).json();
276277

278+
commentId = data.id;
277279
postsArray.push({
278280
id: comment.id,
279281
postId: data.id,

0 commit comments

Comments
 (0)