Class: Query

Query

Class for wrapping jquery request in a promise based on the specified endpoint.

Constructor

new Query()

Source:

Methods

(static) get(path, params, function, function) → {jQueryPromise}

Run a jQuery ajax.get with the configured host for the specified path with given params. Runs
Parameters:
Name Type Description
path string Required. The endpoint for the ajax query
params Hash Optional. Hash of params to pass to the get call
function success Optional. function to call with response object from successful call. If not present, just returns the repsonse object value.
function failure Optional. function to call with the error object from a failed call. If not present, logs the error and returns the error object value.
Source:
Returns:
A promise that either returns the response/error or calls the passed callbacks.
Type
jQueryPromise