From c56b0b786abdb87fa23fc1d34107618b85f26196 Mon Sep 17 00:00:00 2001 From: Zakharov_Rostislav Date: Sat, 2 Dec 2023 20:03:12 +0400 Subject: [PATCH] Does it work? --- Library/js/lines.js | 12 ++++++------ Library/page-edit.html | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) 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 @@
-
@@ -60,7 +60,7 @@
-