Commit 4f83de33 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Use status URL when checking group existence.

This avoids issues with redirects.
parent d2a34cc4
...@@ -30,12 +30,13 @@ document.getElementById('groupform').onsubmit = async function(e) { ...@@ -30,12 +30,13 @@ document.getElementById('groupform').onsubmit = async function(e) {
if(group === '') if(group === '')
return; return;
let url = '/group/' + group + '/'; let url = '/group/' + group + '/';
let statusUrl = url + '.status.json';
try { try {
groupinput.disabled = true; groupinput.disabled = true;
button.disabled = true; button.disabled = true;
try { try {
let resp = await fetch(url, { let resp = await fetch(statusUrl, {
method: 'HEAD', method: 'HEAD',
}); });
if(!resp.ok) { if(!resp.ok) {
...@@ -46,7 +47,7 @@ document.getElementById('groupform').onsubmit = async function(e) { ...@@ -46,7 +47,7 @@ document.getElementById('groupform').onsubmit = async function(e) {
return; return;
} }
} catch(e) { } catch(e) {
displayError(`Coudln't connect: ${e.toString()}`); displayError(`Couldn't connect: ${e.toString()}`);
return; return;
} }
} finally { } finally {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment