Version 0.6.4
Add helpers option #16
{
test: {
url: "/api/test/:name/:id",
helpers: {
get(id, name) {
return [{id, name}], {}]
},
post(id, name, data) {
const {uuid} = this.getState().test;
const urlparams = {id, name};
const params = {body: {uuid, data}};
return [urlparams, params];
}
}
}
}
// using helpers
rest.actions.test.get(1, "admin");
// with callback
rest.actions.post(1, "admin", {msg: "Hello"}, (err)=> {
// end of action
});