diff --git a/frontend/src/js/controllers/profileCtrl.js b/frontend/src/js/controllers/profileCtrl.js index 5545f14cda..8dfc8a6ae7 100644 --- a/frontend/src/js/controllers/profileCtrl.js +++ b/frontend/src/js/controllers/profileCtrl.js @@ -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; @@ -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 = {};