Bug 29002: Ensure bookings stash is up to date
This patch adds the edited/added booking to the bookings stash such that subsequent triggers of the place/edit booking modal will reflect the change in thier picker. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com> Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> Signed-off-by: Laurence Rault <laurence.rault@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
0bf474a338
commit
14afa1318c
1 changed files with 7 additions and 0 deletions
|
@ -450,6 +450,9 @@ $("#placeBookingForm").on('submit', function(e) {
|
|||
);
|
||||
|
||||
posting.done(function(data) {
|
||||
// Update bookings store for subsequent bookings
|
||||
bookings.push(data);
|
||||
|
||||
// Update bookings page as required
|
||||
if (typeof bookings_table !== 'undefined' && bookings_table !== null) {
|
||||
bookings_table.api().ajax.reload();
|
||||
|
@ -500,6 +503,10 @@ $("#placeBookingForm").on('submit', function(e) {
|
|||
putting.done(function(data) {
|
||||
update_success = 1;
|
||||
|
||||
// Update bookings store for subsequent bookings
|
||||
let target = bookings.find((obj) => obj.booking_id === data.booking_id);
|
||||
Object.assign(target,data);
|
||||
|
||||
// Update bookings page as required
|
||||
if (typeof bookings_table !== 'undefined' && bookings_table !== null) {
|
||||
bookings_table.api().ajax.reload();
|
||||
|
|
Loading…
Reference in a new issue