Fix admin phase change UI and ensure cookies on requests
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
@@ -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,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user