returning events with fail_part set.
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16552
dcc99617-32d9-48b4-a31d-
7c20da2025e4
return [OpenILS::Event->new('NO_POLICY_MATCHPOINT')] unless @$results;
return [] if $U->is_true($results->[0]->{success});
- my @events;
- push(@events, OpenILS::Event->new(
- $LEGACY_HOLD_EVENT_MAP->{$_->{fail_part}})) for @$results;
- return \@events;
+ return [
+ map {
+ my $event = new OpenILS::Event(
+ $LEGACY_HOLD_EVENT_MAP->{$_->{"fail_part"}} || $_->{"fail_part"}
+ );
+ $event->{"payload"} = {"fail_part" => $_->{"fail_part"}};
+ $event;
+ } @$results
+ ];
}