Флаг client_read_receipts: не вызывать POST /read по умолчанию (убирает 404 в консоли)

This commit is contained in:
root
2026-05-14 10:31:51 +00:00
parent 2facc3d0d2
commit 306bcc8f51
4 changed files with 10 additions and 2 deletions
+3 -1
View File
@@ -6,6 +6,8 @@
const serverAddress = root.dataset.serverAddress;
const apiBase = root.dataset.supportApiBase;
const supportWsBaseOverride = (root.dataset.supportWsBase || "").trim();
/** Включается в NC: `occ config:app:set f7support client_read_receipts --value=1` после выката API `POST .../read`. */
const clientReadReceiptsEnabled = root.dataset.clientReadReceipts === "1";
const RASTER_IMAGE_EXT = new Set(["jpg", "jpeg", "png", "gif", "webp", "bmp", "tif", "tiff", "heic", "heif"]);
const RASTER_IMAGE_MIME = new Set([
@@ -264,7 +266,7 @@
}
async function markClientTicketRead(ticketNumber) {
if (skipClientReadReceiptPost || !ticketNumber) return;
if (!clientReadReceiptsEnabled || skipClientReadReceiptPost || !ticketNumber) return;
let res;
try {
res = await fetch(`${apiBase}/api/client/tickets/${encodeURIComponent(ticketNumber)}/read`, {