|
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 173-179
$("#placeBookingModal").on("show.bs.modal", function (e) {
Link Here
|
| 173 |
$pickupSelect.empty(); |
164 |
$pickupSelect.empty(); |
| 174 |
|
165 |
|
| 175 |
const filtered_pickup_locations = response.filter(({ pickup_items }) => |
166 |
const filtered_pickup_locations = response.filter(({ pickup_items }) => |
| 176 |
containsAny(pickup_items, bookableItemnumbers) |
167 |
pickup_items.some(pickup_item => |
|
|
168 |
new Set(bookableItemnumbers).has(pickup_item) |
| 169 |
) |
| 177 |
); |
170 |
); |
| 178 |
$.each(filtered_pickup_locations, function (index, pickup_location) { |
171 |
$.each(filtered_pickup_locations, function (index, pickup_location) { |
| 179 |
let option = $( |
172 |
let option = $( |
| 180 |
- |
|
|