diff --git a/README.md b/README.md index 54f7c5db..9b082d14 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # rethink -[![version 1.0.1](https://img.shields.io/badge/pub-1.0.1-brightgreen.svg)](https://pub.dartlang.org/packages/angel_rethink) +[![version 1.0.2](https://img.shields.io/badge/pub-1.0.2-brightgreen.svg)](https://pub.dartlang.org/packages/angel_rethink) [![build status](https://travis-ci.org/angel-dart/rethink.svg?branch=master)](https://travis-ci.org/angel-dart/rethink) RethinkDB-enabled services for the Angel framework. diff --git a/lib/src/rethink_service.dart b/lib/src/rethink_service.dart index aad667cc..41570b75 100644 --- a/lib/src/rethink_service.dart +++ b/lib/src/rethink_service.dart @@ -127,19 +127,25 @@ class RethinkService extends Service { if (type == 'add') { // Create - hookedService.fire(HookedServiceEvent.CREATED, newVal); + hookedService.fireEvent( + hookedService.afterCreated, + new HookedServiceEvent( + true, null, null, this, HookedServiceEvent.CREATED, + result: newVal)); } else if (type == 'change') { // Update - hookedService.fire(HookedServiceEvent.UPDATED, newVal, (e) { - e - ..id = oldVal['id'] - ..data = newVal; - }); + hookedService.fireEvent( + hookedService.afterCreated, + new HookedServiceEvent( + true, null, null, this, HookedServiceEvent.UPDATED, + result: newVal, id: oldVal['od'], data: newVal)); } else if (type == 'remove') { // Remove - hookedService.fire(HookedServiceEvent.CREATED, oldVal, (e) { - e.id = oldVal['id']; - }); + hookedService.fireEvent( + hookedService.afterCreated, + new HookedServiceEvent( + true, null, null, this, HookedServiceEventREMOVED, + result: oldVal, id: oldVal['id'])); } }); } diff --git a/pubspec.yaml b/pubspec.yaml index ae6900c0..8ea2aa6b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_rethink -version: 1.0.1 +version: 1.0.2 description: RethinkDB-enabled services for the Angel framework. author: Tobe O environment: