Skip to content

Product Review Plugin: Unable to upsert from sdk.store.productReviews.upsert #33

@Skidplays

Description

@Skidplays

Unable to upsert from sdk.store.productReviews.upsert.

My function is

export const addProductReview = async (input: StoreUpsertProductReviewsDTO,
) => {
  const headers = {
    ...(await getAuthHeaders()),
  }
  return sdk.store.productReviews.upsert(
    input,
    headers
  )
}

and

const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
    if (!content || !rating) {
      toast.error("Error", {
        description: "Please fill in all required fields.",
      })
      return
    }
    e.preventDefault()
    setIsLoading(true)
    addProductReview({
      reviews: [{
        order_id: orderId,
        order_line_item_id: lineItem.id,
        content: content,
        rating: rating,
        images: []
      }]

My order ID and order line item ID is should be correct as in the database my order line item id product id and order id is the same, I am not using request Id but I don't think it affects the ability to upsert

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions