recidive / choko

Choko Framework
http://choko.org
MIT License
25 stars 9 forks source link

Query API #85

Closed recidive closed 10 years ago

recidive commented 10 years ago

We need add in a simple query API to allow queries to be made to the REST server.

This is a requirement to be able to set filter for reference fields and list pages (#84) and panels (86).

recidive commented 10 years ago

The REST server already take request query data and pass it directly to the list() method on the type model.

We need to create a hook query(typeName, query, callback) so that modules can "force" filters, for e.g. access control to data.

recidive commented 10 years ago

To invoke the hook we can use application.invoke() which is a method inherited from Prana, and the documentation/source can be found around here:

https://github.com/recidive/prana/blob/master/prana.js#L321