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') {
let providedRaPlaLink = $('#raplalink').val().toString();
const url = new URL(providedRaPlaLink);
raplaUser = url.searchParams.get('user');
raplaFile = url.searchParams.get('file');
if(providedRaPlaLink !== '') {
const url = new URL(providedRaPlaLink);
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 {
let courseInfo = courseLinks[selectedCourseFromPicker];
raplaUser = courseInfo.user;