GoalModelEditor/FrontEnd/public/js/dashboard.js
/**
 * Ajax function for renaming a model
 *
 * @param {url} url - to specify the user & model
 * @param {String} mid - modelID - to help rename the model in HTML
 * @param {formData} model - formData with encapsulated model to be renamed
 */
Ajax function for renaming a model
@param {url} url - to specify the user & model
@param {String} mid - modelID - to help rename the model in HTML
@param {formData} model - formData with encapsulated model to be renamed
Ajax function for renaming a model @param { url } url - to specify the user & model @param { String } mid - modelID - to help rename the model in HTML @param { formData } model - formData with encapsulated model to be renamed
function renameModel(url, mid, model) {
    $.ajax(url, {
        data: model,
        type: "PUT",
        headers: {Authorization: "Bearer " + TOKEN},
        success: () => {
            successMessageSlide(
                "Model:" +
                $("#" + mid).find(".model_name").eq(0).html() +
                " successfully renamed to " +
                $("#rename-model .modal-body input").val() +
                "."
            );
            $("#" + mid).find(".model_name").eq(0).html($("#rename-model .modal-body input").val());
        }
    }).fail(function (jqXHR) {
        warningMessageSlide(jqXHR.responseJSON.message + "<br>Please try again.");
    });
}
function renameModel ( url , mid , model ) { $ . ajax ( url , { data : model , type : "PUT" , headers : { Authorization : "Bearer " + TOKEN } , success : ( ) => { successMessageSlide ( "Model:" + $ ( "#" + mid ) . find ( ".model_name" ) . eq ( 0 ) . html ( ) + " successfully renamed to " + $ ( "#rename-model .modal-body input" ) . val ( ) + "." ) ; $ ( "#" + mid ) . find ( ".model_name" ) . eq ( 0 ) . html ( $ ( "#rename-model .modal-body input" ) . val ( ) ) ; } } ) . fail ( function ( jqXHR ) { warningMessageSlide ( jqXHR . responseJSON . message + "<br>Please try again." ) ; } ) ; }
Ajax function for renaming a model
 @param {url} url - to specify the user & model
 @param {String} mid - modelID - to help rename the model in HTML
 @param {formData} model - formData with encapsulated model to be renamed
Ajax function for renaming a model @param { url } url - to specify the user & model @param { String } mid - modelID - to help rename the model in HTML @param { formData } model - formData with encapsulated model to be renamed
// Make the new model name shown in UI