From 476fc13a805392c471c78ee53b1fbe8174caded9 Mon Sep 17 00:00:00 2001 From: regiostech Date: Tue, 3 May 2016 20:55:34 -0400 Subject: [PATCH] :) --- lib/src/http/route.dart | 7 +++++++ lib/src/http/service_hooked.dart | 6 +++--- pubspec.yaml | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/src/http/route.dart b/lib/src/http/route.dart index fa16f72d..03fad12c 100644 --- a/lib/src/http/route.dart +++ b/lib/src/http/route.dart @@ -46,6 +46,13 @@ class Route { return result; } + Route middleware(handler) { + if (handler is Iterable) + handlers.addAll(handler); + else handlers.add(handler); + return this; + } + parseParameters(String requestPath) { Map result = {}; diff --git a/lib/src/http/service_hooked.dart b/lib/src/http/service_hooked.dart index 97de2960..d28185dd 100644 --- a/lib/src/http/service_hooked.dart +++ b/lib/src/http/service_hooked.dart @@ -43,14 +43,14 @@ class HookedService extends Service { @override - Future create(Map data, [Map params]) async { + Future create(data, [Map params]) async { var created = await inner.create(data, params); _onCreated.add(created); return created; } @override - Future modify(id, Map data, [Map params]) async { + Future modify(id, data, [Map params]) async { var modified = await inner.modify(id, data, params); _onUpdated.add(modified); return modified; @@ -58,7 +58,7 @@ class HookedService extends Service { @override - Future update(id, Map data, [Map params]) async { + Future update(id, data, [Map params]) async { var updated = await inner.update(id, data, params); _onUpdated.add(updated); return updated; diff --git a/pubspec.yaml b/pubspec.yaml index 7eff5fe1..48fabb46 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_framework -version: 0.0.0-dev.14 +version: 0.0.0-dev.15 description: Core libraries for the Angel framework. author: Tobe O homepage: https://github.com/angel-dart/angel_framework