|
Lines 1873-1887
Link Here
|
| 1873 |
|
1873 |
|
| 1874 |
let biblioID = $("#biblio_id").val(); |
1874 |
let biblioID = $("#biblio_id").val(); |
| 1875 |
let apiUrl = `/api/v1/items?q={"biblio_id":"${encodeURIComponent(biblioID)}"}`; |
1875 |
let apiUrl = `/api/v1/items?q={"biblio_id":"${encodeURIComponent(biblioID)}"}`; |
| 1876 |
|
|
|
| 1877 |
$.ajax({ |
1876 |
$.ajax({ |
| 1878 |
url: apiUrl, |
1877 |
url: apiUrl, |
| 1879 |
method: "GET", |
1878 |
method: "GET", |
| 1880 |
dataType: "json", |
1879 |
dataType: "json", |
| 1881 |
success: function (data) { |
1880 |
success: function (data) { |
| 1882 |
if (data.length > 0) { |
1881 |
if (data.length > 0) { |
|
|
1882 |
const unique_data = data.filter((item, index, self) => |
| 1883 |
index === self.findIndex(t => t.biblio_id === item.biblio_id) |
| 1884 |
); |
| 1883 |
let resultHtml = ""; |
1885 |
let resultHtml = ""; |
| 1884 |
$.each(data, function (index, item) { |
1886 |
$.each(unique_data, function (index, item) { |
| 1885 |
resultHtml += ` |
1887 |
resultHtml += ` |
| 1886 |
<div class="alert alert-success"> |
1888 |
<div class="alert alert-success"> |
| 1887 |
<strong>Biblionumber:</strong> ${item.biblio_id} <br> |
1889 |
<strong>Biblionumber:</strong> ${item.biblio_id} <br> |
| 1888 |
- |
|
|