Lines 8-22
let bookable_items,
Link Here
|
8 |
booking_patron, |
8 |
booking_patron, |
9 |
booking_itemtype_id; |
9 |
booking_itemtype_id; |
10 |
|
10 |
|
11 |
/** |
|
|
12 |
* @param {number[]} integers1 - The first array of integers to check. |
13 |
* @param {number[]} integers2 - The second array of integers to be checked against. |
14 |
* @returns {boolean} - Returns true if any element from integers1 is found in integers2, otherwise false. |
15 |
*/ |
16 |
function containsAny(integers1, integers2) { |
17 |
return integers1.some(integer => new Set(integers2).has(integer)); |
18 |
} |
19 |
|
20 |
$("#placeBookingModal").on("show.bs.modal", function (e) { |
11 |
$("#placeBookingModal").on("show.bs.modal", function (e) { |
21 |
// Get context |
12 |
// Get context |
22 |
let button = $(e.relatedTarget); |
13 |
let button = $(e.relatedTarget); |
Lines 189-195
$("#placeBookingModal").on("show.bs.modal", function (e) {
Link Here
|
189 |
$pickupSelect.empty(); |
180 |
$pickupSelect.empty(); |
190 |
|
181 |
|
191 |
const filtered_pickup_locations = response.filter(({ pickup_items }) => |
182 |
const filtered_pickup_locations = response.filter(({ pickup_items }) => |
192 |
containsAny(pickup_items, bookableItemnumbers) |
183 |
pickup_items.some(pickup_item => |
|
|
184 |
new Set(bookableItemnumbers).has(pickup_item) |
185 |
) |
193 |
); |
186 |
); |
194 |
$.each(filtered_pickup_locations, function (index, pickup_location) { |
187 |
$.each(filtered_pickup_locations, function (index, pickup_location) { |
195 |
let option = $( |
188 |
let option = $( |
196 |
- |
|
|