diff --git a/Library/js/lines.js b/Library/js/lines.js index 416e220..f61f3da 100644 --- a/Library/js/lines.js +++ b/Library/js/lines.js @@ -44,20 +44,20 @@ async function drawTable() { }); } -async function addLine(item, name, authorId, year, image) { +async function addLine(categoriesId, name, authorId, year, image) { console.info("Try to add item"); // вызов метода REST API для добавления записи - const data = await addBook(item, name, authorId, year, image); + const data = await addBook(categoriesId, name, authorId, year, image); console.info("Added"); console.info(data); // загрузка и заполнение table drawTable(); } -async function editLine(id, item, name, authorId, year, image) { +async function editLine(id, categoriesId, name, authorId, year, image) { console.info("Try to update item"); // вызов метода REST API для обновления записи - const data = await updateBook(id, item, name, authorId, year, image); + const data = await updateBook(id, categoriesId, name, authorId, year, image); console.info("Updated"); console.info(data); // загрузка и заполнение table @@ -106,9 +106,9 @@ export async function linesPageForm() { if (currentId) { try { const book = await getBook(currentId); - cntrls.categoryInput.value = book.itemsId; + cntrls.categoryInput.value = book.categoriesId; cntrls.nameInput.value = book.name; - cntrls.authorInput.value = book.authorId; + cntrls.authorInput.value = book.authorsId; cntrls.yearInput.value = book.year; cntrls.imagePreview.src = book.image ? book.image : imagePlaceholder; } catch { diff --git a/Library/page-edit.html b/Library/page-edit.html index 8d236fe..62afaff 100644 --- a/Library/page-edit.html +++ b/Library/page-edit.html @@ -51,7 +51,7 @@