View | Details | Raw Unified | Return to bug 37618
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js (-11 / +3 lines)
Lines 7-21 let bookable_items, Link Here
7
    booking_patron,
7
    booking_patron,
8
    booking_itemtype_id;
8
    booking_itemtype_id;
9
9
10
/**
11
 * @param {number[]} integers1 - The first array of integers to check.
12
 * @param {number[]} integers2 - The second array of integers to be checked against.
13
 * @returns {boolean} - Returns true if any element from integers1 is found in integers2, otherwise false.
14
 */
15
function containsAny(integers1, integers2) {
16
    return integers1.some(integer => new Set(integers2).has(integer));
17
}
18
19
$("#placeBookingModal").on("show.bs.modal", function (e) {
10
$("#placeBookingModal").on("show.bs.modal", function (e) {
20
    // Get context
11
    // Get context
21
    let button = $(e.relatedTarget);
12
    let button = $(e.relatedTarget);
Lines 196-202 $("#placeBookingModal").on("show.bs.modal", function (e) { Link Here
196
        $pickupSelect.empty();
187
        $pickupSelect.empty();
197
188
198
        const filtered_pickup_locations = response.filter(({ pickup_items }) =>
189
        const filtered_pickup_locations = response.filter(({ pickup_items }) =>
199
            containsAny(pickup_items, bookableItemnumbers)
190
            pickup_items.some(pickup_item =>
191
                new Set(bookableItemnumbers).has(pickup_item)
192
            )
200
        );
193
        );
201
        $.each(filtered_pickup_locations, function (index, pickup_location) {
194
        $.each(filtered_pickup_locations, function (index, pickup_location) {
202
            let option = $(
195
            let option = $(
203
- 

Return to bug 37618