updateReview( )
Updates a review.
Description
The updateReview()
function returns a promise that resolves to the updated review.
Each time the review is updated, revision
increments by 1. The existing revision
must be included
when updating the review. This ensures you're working with the latest review information, and it prevents unintended overwrites.
This function is not a universal function and runs only on the backend.
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Syntax
function updateReview(_id: string, review: UpdateReview): Promise<Review>
updateReview Parameters
NAME
TYPE
DESCRIPTION
Review ID.
Review to update.
Returns
Updated review data.
Return Type:
NAME
TYPE
DESCRIPTION
Date and time the review was created.
Review ID.
Date and time the review was updated.
Author of the review.
Review content.
ID of the entity to review. For example, a Wix Stores product ID.
Number of site visitors who found the review helpful.
Number of site visitors who found the review unhelpful.
Helpfulness score.
Calculated by subtracting foundUnhelpful
from foundHelpful
.
Moderation status of the review.
Review namespace. Currently integrated with Wix Stores, as stores
.
Provides information about the origin of the review. Organic reviews are created by site visitors or members. App reviews are created by apps even though a site visitor or member is the author of the review. Apps can not create or update organic reviews.
Reply to the review.
Date and time then review was written. It should the same time as created_date except for reviews that were imported from the other review system.
Revision number, which increments by 1 each time the review is updated. To prevent conflicting changes, the current revision must be passed when updating the review. Ignored when creating a review.
Indicates whether the review has been verified through a Verify Product Purchase call to the Review Product catalog SPI.
Was this helpful?
updateReview example
1import { reviews } from 'wix-reviews.v2';23 async function updateReview(id, review, options) {4 try {5 const result = await reviews.updateReview(id, review, options);67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13