Skip to content

Commit

Permalink
Merge branch 'master' of github.com:jillix/crud
Browse files Browse the repository at this point in the history
  • Loading branch information
IonicaBizau committed Jul 24, 2014
2 parents fb382ed + f3ceed1 commit a57e804
Showing 1 changed file with 53 additions and 1 deletion.
54 changes: 53 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ myTemplate = {
#### `dev`
- add fixes and new featured here

#### `v0.3.0 betas`
#### `v0.3.0`
- added the `noCursor` crud read request option to automatically convert all the cursors into array. Default `false`
- fixed the linked field filtering
- sort linked fields using JavaScript sort methods after we have the full result array
Expand All @@ -166,6 +166,58 @@ myTemplate = {
- callback the data after running non-read operations and server events
- emit `request.template.callback` event if this is provided (also, don't call the built-in callback)
- dates are converted using [moment.js](http://momentjs.com/) if this is installed. Dates in valid ISO date format (`YYYY-MM-DDThh:mm:ss.MMM`) will be parsed with the `Date` constructor.
- Introduced `before` and `after` configuration:

```js
{
before: {
appId: {
create: "createEventB",
read: "readEventB",
update: "updateEventB",
delete: "deleteEventB"
}
},
after: {
appId: {
create: "createEventA",
read: "readEventA",
update: "updateEventA",
delete: "deleteEventA"
}
}
}
```

or

```js
{
before: { appId: "catchAllB" },
after: { appId: "catchAllA" }
}
```

In server custom scripts we can do:

```js
// before event
M.on("crud:createEventB", function (request, callback) {
// do another db request
foo(request, function (err, data) {
if (err) { return callback(err); }
request.query.something = data.something;
callback(null, request);
});
});
// after event
M.on("crud:createEventA", function (request, err, data, readCount, callback) {
// handle error message
// then send the callback
callback(err, data, readCount);
});
```

#### `v0.2.14`
- Fixed wrong behavior when sorting numbers and strings. Related to #29.
Expand Down

0 comments on commit a57e804

Please sign in to comment.