Fixes to StaffLDB - needs componentisong
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user