mirror of
https://github.com/wowlikon/LiB.git
synced 2026-02-04 12:31:09 +00:00
Доавление векторного поиска и репликации
This commit is contained in:
@@ -242,7 +242,7 @@ $(document).ready(() => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!parseInt(pageCount)) {
|
||||
if (!pageCount) {
|
||||
Utils.showToast("Введите количество страниц", "error");
|
||||
return;
|
||||
}
|
||||
@@ -253,7 +253,7 @@ $(document).ready(() => {
|
||||
const bookPayload = {
|
||||
title: title,
|
||||
description: description || null,
|
||||
page_count: pageCount ? parseInt(pageCount) : null,
|
||||
page_count: pageCount,
|
||||
};
|
||||
|
||||
const createdBook = await Api.post("/api/books/", bookPayload);
|
||||
|
||||
@@ -331,7 +331,7 @@ $(document).ready(() => {
|
||||
|
||||
const title = $titleInput.val().trim();
|
||||
const description = $descInput.val().trim();
|
||||
const pages = $pagesInput.val();
|
||||
const pages = parseInt($("#book-page-count").val()) || null;
|
||||
const status = $statusSelect.val();
|
||||
|
||||
if (!title) {
|
||||
@@ -343,7 +343,7 @@ $(document).ready(() => {
|
||||
if (title !== originalBook.title) payload.title = title;
|
||||
if (description !== (originalBook.description || ""))
|
||||
payload.description = description || null;
|
||||
if (pageCount !== originalBook.page_count) payload.page_count = pages;
|
||||
if (pages !== originalBook.page_count) payload.page_count = pages;
|
||||
if (status !== originalBook.status) payload.status = status;
|
||||
|
||||
if (Object.keys(payload).length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user