Class: DefaultHandler

DefaultHandler

Class defining the default query handler

Constructor

new DefaultHandler()

Source:

Methods

create(data) → {Object}

Create a new resource

Parameters:
Name Type Description
data Object Resource information. Check Thinkific API docs for properties needed
Source:
Returns:
Resource created.
Type
Object

delete(id)

Delete a resource

Parameters:
Name Type Description
id Number Resource id
Source:
Returns:
Empty object (returned by Thinkific API).

find(property, value) → {Object}

Find a resource

Parameters:
Name Type Description
property string Property to match value
value string Value to match with resource property
Source:
Returns:
Resource found or null
Type
Object

getById(id) → {Object}

Get a resource from its id

Parameters:
Name Type Description
id Number Resource id
Source:
Returns:
Resource found.
Type
Object

getList() → {Iterable}

Get the first page of a list resource

Source:
Returns:
A iterable list of resources. Check Iterable object definition.
Type
Iterable

put(id, data)

Update a resource

Parameters:
Name Type Description
id Number Resource id
data Object New resource data object
Source:
Returns:
Empty object (returned by Thinkific API).