mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
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.
This commit is contained in:
parent
6aa7e9cbfa
commit
d0f284129a
|
@ -296,11 +296,11 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
// makes sure we're not selecting the same thing twice for multiples
|
// 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;
|
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) {
|
if(first && first.id) {
|
||||||
first.selected = true;
|
first.selected = true;
|
||||||
|
|
Loading…
Reference in a new issue