Files
surikov/mirzaev/surikovlib/system/public/js/rotate.js
2022-10-13 07:07:04 +03:00

25 lines
687 B
JavaScript

'use strict';
function rotate(id, page, reload = false) {
if (typeof id === 'number' && typeof page === 'number') {
// Получены входные параметры
// Запрос
fetch(`https://surikovlib.ru/books/${id}/${page}/rotate`, {
method: 'POST'
}).then(
(value) => {
return value.json();
}
).then(
(response) => {
if (response.status === true) {
// Перевёрнута страница
if (reload === true) location.reload();
}
}
);
}
}