Добавление количества страниц книгам

This commit is contained in:
2026-01-23 01:31:50 +03:00
parent 1e0c3478a1
commit 7c3074e8fe
15 changed files with 152 additions and 21 deletions
@@ -235,18 +235,25 @@ $(document).ready(() => {
const title = $("#book-title").val().trim();
const description = $("#book-description").val().trim();
const pageCount = parseInt($("#book-page-count").val()) || null;
if (!title) {
Utils.showToast("Введите название книги", "error");
return;
}
if (!parseInt(pageCount)) {
Utils.showToast("Введите количество страниц", "error");
return;
}
setLoading(true);
try {
const bookPayload = {
title: title,
description: description || null,
page_count: pageCount ? parseInt(pageCount) : null,
};
const createdBook = await Api.post("/api/books/", bookPayload);