updateReviewWorkflow run that sets status, and removal is a deleteReviewWorkflow run that soft deletes the review.
1
Set the status
Run Routes under
updateReviewWorkflow with the review id and the new status:src/api/admin/review-moderation/[id]/route.ts
/admin require an authenticated admin user by default. The workflow returns the updated review.2
Delete a review
Add a The review gets a
DELETE handler to the same file that runs deleteReviewWorkflow with the review id as its whole input:src/api/admin/review-moderation/[id]/route.ts
deleted_at timestamp. Its row and its four links stay in the database.Publish reviews automatically
Run the moderation from a subscriber to publish reviews without an operator. The module emitsreview.review.created with the new review’s id, so you can load the review and decide:
src/subscribers/auto-publish-reviews.ts
pending for an operator. See the Events reference for the payload.
Correct a review’s content
updateReviewWorkflow also accepts rating, customer_note, and seller_note. Use it to fix a rating, redact a note, or clear a store’s answer:
rating, customer_note, seller_note, and status before it writes, and restores them if a later step fails.
Account for soft deleted reviews in averages
A soft deleted review disappears fromquery.graph and the APIs, but the service’s rating helpers still count it, because their query doesn’t check deleted_at. Compute averages with query.graph if deletions must change the number, as shown in Compute aggregate ratings.