Search.../

onCommentUpdated( )

A backend event that fires when a forum comment is updated.

Description

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.

Syntax

function onCommentUpdated(event: UpdatedComment): void

onCommentUpdated Parameters

NAME
TYPE
DESCRIPTION
event
UpdatedComment

Information about the forum comment that was updated.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

A backend event that occurs when a forum comment is updated

Copy Code
1// Place this code in a file named events.js
2// in the Backend section of your code files.
3
4export function wixForum_onCommentUpdated(event) {
5 const commentId = event.commentId;
6 const commentText = event.comment.plainContent;
7}
8
9/* Full comment object:
10 * {
11 * "_id": "5f88058be9b6b100175b154c",
12 * "postId":"5f88058be9b6b100175b154a",
13 * "_ownerId":"32cf071a-ck2f-450f-ad74-5a25db0b1b6g",
14 * "plainContent": "This is my updated comment text.",
15 * "replyCount": 2,
16 * "likeCount": 5,
17 * "upvoteCount": 4,
18 * "downvoteCount": 6,
19 * "score": -2,
20 * "_createdDate": "2020-10-26T07:18:20.297Z",
21 * "_editedDate": "2020-11-04T12:27:05.592Z",
22 * "_lastActivityDate": "2020-11-04T12:27:05.592Z",
23 * "pageUrl": "/forum/main/comment/5f88058be9b6b100175b154c"
24 * }
25 */