Fix admin phase change UI and ensure cookies on requests

This commit is contained in:
2026-01-29 02:07:31 +01:00
parent dab5e9f723
commit 0a91c685ac
2 changed files with 4 additions and 0 deletions

View File

@@ -341,7 +341,10 @@ function setupHandlers() {
try { try {
await adminApi.setPhase(phase); await adminApi.setPhase(phase);
toast("Phase updated"); toast("Phase updated");
state.prevPhase = state.phase;
state.phase = phase; state.phase = phase;
state.votesRendered = false;
renderPhasePill();
$("phase-select").dataset.userEditing = ""; $("phase-select").dataset.userEditing = "";
await refreshPhaseData(); await refreshPhaseData();
} catch (err) { } catch (err) {

View File

@@ -11,6 +11,7 @@ const withBase = (path) => `${basePath}${path}`;
async function request(path, { method = "GET", body } = {}) { async function request(path, { method = "GET", body } = {}) {
const res = await fetch(withBase(path), { const res = await fetch(withBase(path), {
method, method,
credentials: "same-origin",
headers: defaultHeaders, headers: defaultHeaders,
body: body ? JSON.stringify(body) : undefined, body: body ? JSON.stringify(body) : undefined,
}); });