index method
Retrieves all resources.
Implementation
@override
Future<List<Data>> index([Map<String, dynamic>? params]) {
var localParams = _stripReq(params);
return beforeIndexed
._emit(HookedServiceEvent(false, _getRequest(params),
_getResponse(params), inner, HookedServiceEvent.indexed,
params: localParams))
.then((before) {
if (before._canceled) {
return afterIndexed
._emit(HookedServiceEvent(true, _getRequest(params),
_getResponse(params), inner, HookedServiceEvent.indexed,
params: localParams, result: before.result))
.then((after) => after.result as List<Data>);
}
return inner.index(localParams).then((result) {
return afterIndexed
._emit(HookedServiceEvent(true, _getRequest(params),
_getResponse(params), inner, HookedServiceEvent.indexed,
params: localParams, result: result))
.then((after) => after.result as List<Data>);
});
});
}