[lightMode]
Fetch
The fetch endpoint allows you to retrieve comments related to a particular object or resource within the platform. By making a request to this endpoint, you can retrieve comments made by users or customers, providing valuable insights, feedback, and discussions related to the specific object.
Payload
Response
Usage
To fetch the customer's comment about a specific product or a specific page, the developer may call the fetch
method.
salla.comment.fetch({
id: 85214,
comment: "The product's price is good",
type: "product",
})
.then((response) => {
/* add your code here */
});
Events
This endpoint may trigger two events, the onFetch and onFetchedFailed events.
onFetch
This event is triggered when fetching a comment by the customer is done without having any errors coming back from the backend.
salla.event.comment.Fetch((response) => {
console.log(response)
});
onFetchedFailed
This event is triggered when when fetching a new comment by the customer is not completed and an error has occurred.
salla.event.comment.onFetchedFailed((errorMessage) => {
console.log(errorMessage)
});
[updatedIn] 10 months ago
Payload
Response
Usage
Events
onFetch
onFetchedFailed