Update user.dart

This commit is contained in:
Tobe O 2017-02-25 19:21:52 -05:00 committed by GitHub
parent bb07cd1092
commit 7fbd4addfc

View file

@ -28,12 +28,9 @@ String hashPassword(String password) =>
/// ///
/// Here, we extended the base service class. This allows to only expose /// Here, we extended the base service class. This allows to only expose
/// specific methods, and also allows more freedom over things such as validation. /// specific methods, and also allows more freedom over things such as validation.
class UserService extends Service { class UserService extends TypedService<User> {
TypedService<User> _inner;
UserService(DbCollection collection) : super() { UserService(DbCollection collection) : super(new MongoService(collection));
_inner = new TypedService<User>(new MongoService(collection));
}
@override @override
index([Map params]) { index([Map params]) {
@ -42,7 +39,7 @@ class UserService extends Service {
throw new AngelHttpException.forbidden(); throw new AngelHttpException.forbidden();
} }
return _inner.index(params); return super.index(params);
} }
@override @override
@ -52,9 +49,6 @@ class UserService extends Service {
throw new AngelHttpException.forbidden(); throw new AngelHttpException.forbidden();
} }
return _inner.create(data, params); return super.create(data, params);
} }
@override
read(id, [Map params]) => _inner.read(id, params);
} }