GRN2-196: Fixed issues that scrutinizer is complaining about (#765)

* Refactored code to improve scrutinizer score

* Bug fixes
This commit is contained in:
farhatahmad
2019-08-27 11:08:58 -04:00
committed by farhatahmad
parent fd6077696d
commit 01b8dbbd0e
33 changed files with 462 additions and 434 deletions

View File

@ -124,7 +124,7 @@ $(document).on('turbolinks:load', function(){
submit_update_request({
setting: "rename_header",
room_name: element.find('#user-text').text(),
}, element.data('path'));
}, element.data('path'), "POST");
}
else if(element.is('#recording-title')){
submit_update_request({
@ -132,16 +132,16 @@ $(document).on('turbolinks:load', function(){
record_id: element.data('recordid'),
record_name: element.find('text').text(),
room_uid: element.data('room-uid'),
}, element.data('path'));
}, element.data('path'), "PATCH");
}
}
// Helper for submitting ajax requests
var submit_update_request = function(data, path){
var submit_update_request = function(data, path, action){
// Send ajax request for update
$.ajax({
url: path,
type: "PATCH",
type: action,
data: data,
});
}