To create a custom object, call the create(resourceName, params, completion) function from the Turbo SDK which takes a resource name argument, parameters JSON argument and a callback:..assets/js/app.js
All entites can be viewed, updated, and deleted on the entities dashboard for each project. To view the dashboard, log in to your Turbo 360 account and click on your project. From there, click the "entities" menu item on the left hand menu then click the dropdown menu which appears. Among the menu items should be your custom resource(s). Click on a custom resource to view all current entities under that category:Click to enlarge
To fetch a specific entity by ID number, call the fetchOne(resourceName, id, completion) method:
The 'data' argument in the callback will contain the entity fetched. If it is not found, the 'err' argument will be populated instead with corresponding message key...assets/js/app.js
Fetching multiple entities with a query filter is also supported by the datastore. To do so, use the fetch(resourceName, filters, completion) method:
Note that if no entities are returned, the 'err' argument is NOT populated - the 'data' argument returns with an empty array.
Updating objects is done through the update(resourceName, entity, params, completion) function. The arguments are as follows:
The update command above will add two new fields to the original team object: 'sport' and 'league'. Current fields can be changed as well through this method.
To delete an object, use the remove(resourceName, entity, completion) method.
If you have any questions, comments or feedback, feel free to contact us at email@example.com