Флаг client_read_receipts: не вызывать POST /read по умолчанию (убирает 404 в консоли)
This commit is contained in:
+3
-1
@@ -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`, {
|
||||
|
||||
Reference in New Issue
Block a user