Fixes to StaffLDB - needs componentisong

This commit is contained in:
Fred Boniface
2023-07-09 08:12:25 +01:00
parent 13d3bc4dbe
commit 45b64002f4
6 changed files with 134 additions and 251 deletions

View File

@@ -53,22 +53,22 @@
const url = `https://owlboard.info/api/v2/timetable/train/${date}/${searchType}/${id}`;
try {
const res = await fetch(url, options);
if (res.status == 200) {
return await res.json();
} else if (res.status === 401) {
error = true;
errMsg = 'You must be logged into the staff version for this feature';
return false;
} else {
error = true;
errMsg = 'Unable to connect, check your connection and try again';
return false;
}
} catch (err) {
error = true;
errMsg = 'Connection error, try again later';
}
isLoading = false;
if (res.status == 200) {
return await res.json();
} else if (res.status === 401) {
error = true;
errMsg = 'You must be logged into the staff version for this feature';
return false;
} else {
error = true;
errMsg = 'Unable to connect, check your connection and try again';
return false;
}
}
</script>