From d0f284129adc49e96d6de1d0f6fa32cef0f089f2 Mon Sep 17 00:00:00 2001 From: Sam <1631095+takuy@users.noreply.github.com> Date: Thu, 23 Sep 2021 20:12:45 -0400 Subject: [PATCH] Update expected field for response list The existing code to handle the "enter key" / auto selections broke at some point. It was expecting results to be in an "items" list, not a "results" list. This should close #9928 hopefully. Tested locally. --- resources/assets/js/snipeit.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/assets/js/snipeit.js b/resources/assets/js/snipeit.js index 91fbfbe22..a7f3f2668 100755 --- a/resources/assets/js/snipeit.js +++ b/resources/assets/js/snipeit.js @@ -296,11 +296,11 @@ $(document).ready(function () { }); // makes sure we're not selecting the same thing twice for multiples - var filteredResponse = response.items.filter(function(item) { + var filteredResponse = response.results.filter(function(item) { return currentlySelected.indexOf(+item.id) < 0; }); - var first = (currentlySelected.length > 0) ? filteredResponse[0] : response.items[0]; + var first = (currentlySelected.length > 0) ? filteredResponse[0] : response.results[0]; if(first && first.id) { first.selected = true; @@ -558,4 +558,4 @@ $(document).ready(function () { }); }; -})(jQuery); \ No newline at end of file +})(jQuery);