Modules.Cloud.Reviews
> Modules.Cloud.Reviews

Provides methods for accessing ArrowDB reviews.

Examples

Create Review

This example creates a new review and checks the response.

Cloud.Reviews.create({
    post_id: savedPostId,
    rating: 1,
    content: 'Good'
}, function (e) {
    if (e.success) {
        var review = e.reviews[0];
        alert('Success:\n' +
            'id: ' + review.id + '\n' +
            'rating: ' + review.rating + '\n' +
            'content: ' + review.content + '\n' +
            'updated_at: ' + review.updated_at);
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Show a Review

This example retrieves information about a review and checks the response.

Cloud.Reviews.show({
    post_id: savedPostId,
    review_id: savedReviewId
}, function (e) {
    if (e.success) {
        var review = e.reviews[0];
        alert('Success:\n' +
            'id: ' + review.id + '\n' +
            'rating: ' + review.rating + '\n' +
            'content: ' + review.content + '\n' +
            'updated_at: ' + review.updated_at);
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Query for Reviews

This example requests a list of reviews and checks the response.

Cloud.Reviews.query({
    page: 1,
    per_page: 20,
    where: {
        rating: { '$gt': 5.0 }
    }
}, function (e) {
    if (e.success) {
        alert('Success:\n' +
            'Count: ' + e.reviews.length);
        for (var i = 0; i < e.reviews.length; i++) {
            var review = e.reviews[i];
            alert('id: ' + review.id + '\n' +
                'id: ' + review.id + '\n' +
                'rating: ' + review.rating + '\n' +
                'content: ' + review.content + '\n' +
                'updated_at: ' + review.updated_at);
        }
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Update a Review

This example updates a review and checks the response.

Cloud.Reviews.update({
    post_id: savedPostId,
    review_id: savedReviewId,
    rating: 100,
    content: 'Very good!'
}, function (e) {
    if (e.success) {
        var review = e.reviews[0];
        alert('Success:\n' +
            'id: ' + review.id + '\n' +
            'rating: ' + review.rating + '\n' +
            'content: ' + review.content + '\n' +
            'updated_at: ' + review.updated_at);
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Remove a Review

This example deletes a review and checks the response.

Cloud.Reviews.remove({
    post_id: savedPostId,
    review_id: savedReviewId
}, function (e) {
    if (e.success) {
        alert('Success');
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});
  • 0.8
  • 0.8
  • 0.8
Defined By

Properties

apiName : Stringreadonly

The name of the API that this proxy corresponds to.

The name of the API that this proxy corresponds to.

The value of this property is the fully qualified name of the API. For example, Button returns Ti.UI.Button.

  • 3.2.0
  • 3.2.0
  • 3.2.0
Indicates if the proxy will bubble an event to its parent. ...

Indicates if the proxy will bubble an event to its parent.

Some proxies (most commonly views) have a relationship to other proxies, often established by the add() method. For example, for a button added to a window, a click event on the button would bubble up to the window. Other common parents are table sections to their rows, table views to their sections, and scrollable views to their views. Set this property to false to disable the bubbling to the proxy's parent.

Default: true

  • 3.0.0
  • 3.0.0
  • 3.0.0

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

If this property is set to a Window or TabGroup, then the corresponding Activity lifecycle event callbacks will also be called on the proxy. Proxies that require the activity lifecycle will need this property set to the appropriate containing Window or TabGroup.

  • 3.6.0
Defined By

Methods

Applies the properties to the proxy. ...

Applies the properties to the proxy.

Properties are supplied as a dictionary. Each key-value pair in the object is applied to the proxy such that myproxy[key] = value.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • props : Dictionary

    A dictionary of properties to apply.

Returns

  • void
Modules.Cloud.Reviews
( parameters, callback )
Add a review, comment, rating, or like. ...

Add a review, comment, rating, or like.

Requires user login.

See Reviews: Create Review/Comment/Rating/Like for the request parameters supported by this method.

Data is returned in the reviews property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudReviewsResponse>

    Callback function to execute when the method completes.

Returns

  • void
Gets the value of the apiName property. ...

Gets the value of the apiName property.

  • 3.2.0
  • 3.2.0
  • 3.2.0

Returns

  • String
Gets the value of the bubbleParent property. ...

Gets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Returns

  • Boolean
Gets the value of the lifecycleContainer property. ...

Gets the value of the lifecycleContainer property.

  • 3.6.0

Returns

Modules.Cloud.Reviews
( parameters, callback )
Retrieve a list of reviews with sorting and pagination. ...

Retrieve a list of reviews with sorting and pagination.

See Reviews: Custom Query Reviews/Comments/Ratings/Likes for the request parameters supported by this method.

Data is returned in the reviews property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudReviewsResponse>

    Callback function to execute when the method completes.

Returns

  • void
Modules.Cloud.Reviews
( parameters, callback )
Delete a review. ...

Delete a review.

Requires user login.

See Reviews: Delete a Review/Comment/Rating/Like for the request parameters supported by this method.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudReviewsResponse>

    Callback function to execute when the method completes.

Returns

  • void
Sets the value of the bubbleParent property. ...

Sets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • bubbleParent : Boolean

    New value for the property.

Returns

  • void
Sets the value of the lifecycleContainer property. ...

Sets the value of the lifecycleContainer property.

  • 3.6.0

Parameters

Returns

  • void
Modules.Cloud.Reviews
( parameters, callback )
Retrieve details of a review. ...

Retrieve details of a review.

See Reviews: Show a review for the request parameters supported by this method.

Data is returned in the reviews property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudReviewsResponse>

    Callback function to execute when the method completes.

Returns

  • void
Modules.Cloud.Reviews
( parameters, callback )
Update a review. ...

Update a review.

Requires user login.

See Reviews: Update a Review/Comment/Rating/Like for the request parameters supported by this method.

Data is returned in the reviews property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudReviewsResponse>

    Callback function to execute when the method completes.

Returns

  • void