if ( $cancel_reason ) {
$aur_obj->cancel_reason( $cancel_reason );
$e->update_acq_user_request($aur_obj) or return $e->die_event;
- create_user_request_events( [ $aur_obj ], 'aur.rejected' );
+ create_user_request_events( $e, [ $aur_obj ], 'aur.rejected' );
} else {
$e->delete_acq_user_request($aur_obj);
}
}
}
- $aur_obj = $e->create_acq_user_request($aur_obj) or $e->die_event;
+ $aur_obj = $e->create_acq_user_request($aur_obj) or return $e->die_event;
- $e->commit;
-
- create_user_request_events( [ $aur_obj ], 'aur.created' );
+ $e->commit and create_user_request_events( $e, [ $aur_obj ], 'aur.created' );
return $aur_obj;
}
sub create_user_request_events {
- my($user_reqs, $hook) = @_;
+ my($e, $user_reqs, $hook) = @_;
my $ses = OpenSRF::AppSession->create('open-ils.trigger');
$ses->connect;