feat: comment to comment

This commit is contained in:
Nevo David 2025-06-24 17:55:52 +07:00
parent d6b72a7e50
commit 313380e183
1 changed files with 4 additions and 2 deletions

View File

@ -254,10 +254,11 @@ export class FacebookProvider extends SocialAbstract implements SocialProvider {
}
const postsArray = [];
for (const comment of comments.reverse()) {
let commentId = finalId;
for (const comment of comments) {
const data = await (
await this.fetch(
`https://graph.facebook.com/v20.0/${finalId}/comments?access_token=${accessToken}&fields=id,permalink_url`,
`https://graph.facebook.com/v20.0/${commentId}/comments?access_token=${accessToken}&fields=id,permalink_url`,
{
method: 'POST',
headers: {
@ -274,6 +275,7 @@ export class FacebookProvider extends SocialAbstract implements SocialProvider {
)
).json();
commentId = data.id;
postsArray.push({
id: comment.id,
postId: data.id,