if (!evt || !(payload = evt.payload)) return $q.when();
promises.push(service.flesh_copy_location(payload.copy));
- promises.push(service.flesh_copy_status(payload.copy));
+ promises.push(
+ service.flesh_copy_status(payload.copy)
+
+ .then(function() {
+ // copy is in transit, but no transit was delivered
+ // in the payload. Do this here instead of below to
+ // ensure consistent copy status fleshiness
+ if (!payload.transit && payload.copy.status().id() == 6) { // in-transit
+ return service.find_copy_transit(evt, params, options)
+ .then(function(trans) {
+ if (trans) {
+ trans.source(egCore.org.get(trans.source()));
+ trans.dest(egCore.org.get(trans.dest()));
+ payload.transit = trans;
+ }
+ })
+ }
+ })
+ );
// local flesh transit
if (transit = payload.transit) {
transit.source(egCore.org.get(transit.source()));
transit.dest(egCore.org.get(transit.dest()));
- }
+ }
// TODO: renewal responses should include the patron
if (!payload.patron && payload.circ) {