тест 6
This commit is contained in:
@@ -3723,5 +3723,39 @@ function getTourChannelLogoPath(matchId) {
|
||||
return "D:\\Графика\\ФУТБОЛ\\Женская Суперлига 2026\\Photo\\EMPTY.png";
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
async function saveTourChannel(matchExternalId) {
|
||||
const channel = buildChannelValue(matchExternalId);
|
||||
|
||||
const res = await fetch(`/admin/session/${MATCH_DATA.sessionToken}/schedule/channel`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
match_external_id: String(matchExternalId),
|
||||
channel
|
||||
})
|
||||
});
|
||||
|
||||
if (!res.ok) {
|
||||
alert("Не удалось сохранить канал");
|
||||
}
|
||||
}
|
||||
|
||||
function buildChannelValue(matchId) {
|
||||
const checked = Array.from(
|
||||
document.querySelectorAll(`.tour-channel-checkbox[data-match-id="${matchId}"]:checked`)
|
||||
).map(el => el.dataset.channel);
|
||||
|
||||
const hasMatch = checked.includes("match");
|
||||
const hasPremier = checked.includes("match_premier");
|
||||
|
||||
if (hasMatch && hasPremier) return "match_and_premier";
|
||||
if (hasPremier) return "match_premier";
|
||||
if (hasMatch) return "match";
|
||||
|
||||
return "";
|
||||
}
|
||||
Reference in New Issue
Block a user