LP#1796971 Wait for call number and copy before loading locations user/dbwells/lp1796971_wait_for_call_number_copy_load
authorDan Wells <dbw2@calvin.edu>
Thu, 11 Oct 2018 13:21:05 +0000 (09:21 -0400)
committerDan Wells <dbw2@calvin.edu>
Thu, 11 Oct 2018 13:21:05 +0000 (09:21 -0400)
commit7a53390ef6496940dd7999b842b0be368c789123
tree14d90352b336b9ef8543619d2058164a92d0317e
parent928feebd6f822029f16fddaf832c279a9a65e672
LP#1796971 Wait for call number and copy before loading locations

In cases where add a copy to a call number, we fetch the original
call number via async, then attach the new copy to it.  Before this
commit, however, we were not waiting for the call number fetch
promise to resolve, so the copy wasn't there to use for limiting the
location load.

Since the async request is internal to a loop, one way out is to
capture that promise, then make sure it resolves before loading the
locations.

(We previously returned the copies from the internal function, but that
value wasn't being used anyway, so we don't worry about unwrapping the
$q.all() when it resolves.)

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js