A backend event that fires when a forum comment is updated.
The onCommentUpdated()
event handler runs when a an existing forum comment in your site is updated.
The received UpdatedComment
object contains information about the comment that was updated.
Note: Backend events are not fired when previewing your site.
function onCommentUpdated(event: UpdatedComment): void;
Information about the forum comment that was updated.
// Place this code in a file named events.js
// in the Backend section of your code files.
export function wixForum_onCommentUpdated(event) {
const commentId = event.commentId;
const commentText = event.comment.plainContent;
}
/* Full comment object:
* {
* "_id": "5f88058be9b6b100175b154c",
* "postId":"5f88058be9b6b100175b154a",
* "_ownerId":"32cf071a-ck2f-450f-ad74-5a25db0b1b6g",
* "plainContent": "This is my updated comment text.",
* "replyCount": 2,
* "likeCount": 5,
* "upvoteCount": 4,
* "downvoteCount": 6,
* "score": -2,
* "_createdDate": "2020-10-26T07:18:20.297Z",
* "_editedDate": "2020-11-04T12:27:05.592Z",
* "_lastActivityDate": "2020-11-04T12:27:05.592Z",
* "pageUrl": "/forum/main/comment/5f88058be9b6b100175b154c"
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.