A backend event that fires when a forum post is updated.
The onPostUpdated()
event handler runs when a an existing forum post in your site is updated.
The received UpdatedPost
object contains information about the post that was updated.
Note: Backend events are not fired when previewing your site.
function onPostUpdated(event: UpdatedPost): void;
Information about the forum post that was updated.
// Place this code in a file named events.js
// in the Backend section of your code files.
export function wixForum_onPostUpdated(event) {
const postId = event.postId;
const posterId = event.post.ownerId;
}
/* Full post object:
* {
* "_id": "5f88058be9b6b100175b154f",
* "categoryId":"5f88058be9b6b100175b154d",
* "_ownerId":"32cf071a-ck2f-450f-ad74-5a25db0b1b6g",
* "title": "My Updated Post Title",
* "plainContent": "This is the updated text of my post.",
* "pinned": "true",
* "commentingDisabled": "false",
* "commentCount": 4,
* "likeCount": 13,
* "viewCount": 76,
* "_createdDate": "2020-10-26T07:18:20.297Z",
* "_editedDate": "2020-11-04T12:27:05.592Z",
* "_lastActivityDate": "2020-11-04T12:27:05.592Z",
* "slug": "my-updated-post-title",
* "pageUrl": "/forum/category-name/my-updated-post-title",
* "postType": "DISCUSSION"
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.