Getting an error while posting a comment in community

Hi there.

Seems we have an issue in posting a comment in a community. I am getting this error:

"error": {
  "code": 500000,
  "jsEngine": "hermes",
  "level": "error",
  "timestamp": 1690283554723,
  "type": "ASC"
}

My dependencies:

"@amityco/ts-sdk": "^6.3.1"
"react-native": "0.70.6"

My Code:

CommentRepository.createComment(queryOptions).then((comment) => {
  resolve(comment);
});

Query options:

    "queryOptions": {
      "attachments": [],
      "data": {
        "text": "Hi yes I read it."
      },
      "referenceId": "64bf09db1e14788f7d6d4b8c",
      "referenceType": "post"
    }

Seems to be an issue with the code, please try the sample code below:

  const queryOptions = {
          data: {
            text: text,
          },
          referenceId: postId,
          referenceType: 'post' as Amity.CommentReferenceType,
        };

        const { data: comment } = await CommentRepository.createComment(
          queryOptions
        );
        resolve(comment);
1 Like