Skip to content
Open
11 changes: 7 additions & 4 deletions frontend/src/js/controllers/profileCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
vm.status = 'Show';
vm.token = '';
vm.expiresAt = '';
const urlFields = ["github_url", "google_scholar_url", "linkedin_url"];

// default parameters
$rootScope.canShowOldPassword = false;
Expand Down Expand Up @@ -227,10 +228,12 @@
vm.user.google_scholar_url = vm.user.google_scholar_url === null ? "" : vm.user.google_scholar_url;
vm.user.linkedin_url = vm.user.linkedin_url === null ? "" : vm.user.linkedin_url;

if (!vm.isURLValid(vm.user[editid])) {
vm.isFormError = true;
$rootScope.notify("error", "URL length should not be greater than 200 or is in invalid format!");
return;
if(urlFields.includes(editid)){
if (!vm.isURLValid(vm.user[editid])) {
vm.isFormError = true;
$rootScope.notify("error", "URL must be valid and should not exceed 200 characters.");
return;
}
}

var parameters = {};
Expand Down