ui: Add Accept header to retrieve JSON errors
This commit is contained in:
parent
de03863f1b
commit
bd8db24997
@ -43,6 +43,7 @@
|
|||||||
"submit/" + exercice.id,
|
"submit/" + exercice.id,
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
headers: {'Accept': 'application/json'},
|
||||||
body: JSON.stringify(responses),
|
body: JSON.stringify(responses),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
"openhint/" + exercice.id,
|
"openhint/" + exercice.id,
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
headers: {'Accept': 'application/json'},
|
||||||
body: JSON.stringify({ id: hint.id }),
|
body: JSON.stringify({ id: hint.id }),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
"wantchoices/" + exercice_id,
|
"wantchoices/" + exercice_id,
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
headers: {'Accept': 'application/json'},
|
||||||
body: JSON.stringify({ id: Number(flag.id) }),
|
body: JSON.stringify({ id: Number(flag.id) }),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
|
|
||||||
const response = await fetch('chname', {
|
const response = await fetch('chname', {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
headers: {'Accept': 'application/json'},
|
||||||
body: JSON.stringify({newName: newTeamName}),
|
body: JSON.stringify({newName: newTeamName}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.update(await fetch('settings.json'), cb);
|
settings.update(await fetch('settings.json', {headers: {'Accept': 'application/json'}}), cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
let refresh_interval_teams = null;
|
let refresh_interval_teams = null;
|
||||||
@ -45,7 +45,7 @@
|
|||||||
}
|
}
|
||||||
refresh_interval_teams = setInterval(refresh_teams, interval);
|
refresh_interval_teams = setInterval(refresh_teams, interval);
|
||||||
|
|
||||||
teamsStore.update(await fetch('teams.json'), cb);
|
teamsStore.update(await fetch('teams.json', {headers: {'Accept': 'application/json'}}), cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
let refresh_interval_themes = null;
|
let refresh_interval_themes = null;
|
||||||
@ -57,7 +57,7 @@
|
|||||||
}
|
}
|
||||||
refresh_interval_themes = setInterval(refresh_themes, interval);
|
refresh_interval_themes = setInterval(refresh_themes, interval);
|
||||||
|
|
||||||
await themesStore.update(await fetch('themes.json'), cb);
|
await themesStore.update(await fetch('themes.json', {headers: {'Accept': 'application/json'}}), cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
let refresh_interval_my = null;
|
let refresh_interval_my = null;
|
||||||
@ -69,7 +69,7 @@
|
|||||||
}
|
}
|
||||||
refresh_interval_my = setInterval(refresh_my, interval);
|
refresh_interval_my = setInterval(refresh_my, interval);
|
||||||
|
|
||||||
my.update(await fetch('my.json'), cb);
|
my.update(await fetch('my.json', {headers: {'Accept': 'application/json'}}), cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
let refresh_interval_issues = null;
|
let refresh_interval_issues = null;
|
||||||
@ -81,7 +81,7 @@
|
|||||||
}
|
}
|
||||||
refresh_interval_issues = setInterval(refresh_issues, interval);
|
refresh_interval_issues = setInterval(refresh_issues, interval);
|
||||||
|
|
||||||
issuesStore.update(await fetch('issues.json'), cb);
|
issuesStore.update(await fetch('issues.json', {headers: {'Accept': 'application/json'}}), cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function load({ page, fetch, session, context }) {
|
export async function load({ page, fetch, session, context }) {
|
||||||
|
@ -76,6 +76,7 @@
|
|||||||
|
|
||||||
const response = await fetch('issue', {
|
const response = await fetch('issue', {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
headers: {'Accept': 'application/json'},
|
||||||
body: JSON.stringify(issue),
|
body: JSON.stringify(issue),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -68,6 +68,7 @@
|
|||||||
|
|
||||||
const response = await fetch('registration', {
|
const response = await fetch('registration', {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
headers: {'Accept': 'application/json'},
|
||||||
body: JSON.stringify(form),
|
body: JSON.stringify(form),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user