Better error when neither course nor rapla link are supplied
All checks were successful
Jenkins Production Deployment

This commit is contained in:
Patrick Müller 2021-10-09 15:29:18 +02:00
parent 5d9a2d6d22
commit fba5368a58

View File

@ -32,9 +32,14 @@ function generateLink() {
if (selectedCourseFromPicker === '-1') { if (selectedCourseFromPicker === '-1') {
let providedRaPlaLink = $('#raplalink').val().toString(); let providedRaPlaLink = $('#raplalink').val().toString();
const url = new URL(providedRaPlaLink); if(providedRaPlaLink !== '') {
raplaUser = url.searchParams.get('user'); const url = new URL(providedRaPlaLink);
raplaFile = url.searchParams.get('file'); raplaUser = url.searchParams.get('user');
raplaFile = url.searchParams.get('file');
} else {
$('#full-link').text('Please provide either a course or a RaPla Link!');
return;
}
} else { } else {
let courseInfo = courseLinks[selectedCourseFromPicker]; let courseInfo = courseLinks[selectedCourseFromPicker];
raplaUser = courseInfo.user; raplaUser = courseInfo.user;