GoalModelEditor/FrontEnd/public/js/dashboard.js
/**
 * Ajax function for renaming a project
 *
 * @param {url} url - to specify the user & project
 * @param {String} pid - projectID - to help notifications and the corresponding change in HTML
 * @param {formData} project - formData with encapsulated new projectName
 */
Ajax function for renaming a project
@param {url} url - to specify the user & project
@param {String} pid - projectID - to help notifications and the corresponding change in HTML
@param {formData} project - formData with encapsulated new projectName
Ajax function for renaming a project @param { url } url - to specify the user & project @param { String } pid - projectID - to help notifications and the corresponding change in HTML @param { formData } project - formData with encapsulated new projectName
function renameProject(url, pid, project) {
    $.ajax(url, {
        data: project,
        type: "PUT",
        headers: {
            Authorization: "Bearer " + TOKEN
        },
        success: () => {
            successMessageSlide(
                "Project:" +
                $("#" + pid).find(".project_name").eq(0).html() +
                " successfully renamed to " + project.project_name + "."
            );
            $("#" + pid).find(".project_name").eq(0).html(project.project_name);
        }
    }).fail(function(jqXHR) {
        warningMessageSlide(
            jqXHR.responseJSON.message + "<br>Please try again."
        );
    });
}
function renameProject ( url , pid , project ) { $ . ajax ( url , { data : project , type : "PUT" , headers : { Authorization : "Bearer " + TOKEN } , success : ( ) => { successMessageSlide ( "Project:" + $ ( "#" + pid ) . find ( ".project_name" ) . eq ( 0 ) . html ( ) + " successfully renamed to " + project . project_name + "." ) ; $ ( "#" + pid ) . find ( ".project_name" ) . eq ( 0 ) . html ( project . project_name ) ; } } ) . fail ( function ( jqXHR ) { warningMessageSlide ( jqXHR . responseJSON . message + "<br>Please try again." ) ; } ) ; }
Ajax function for renaming a project
 @param {url} url - to specify the user & project
 @param {String} pid - projectID - to help notifications and the corresponding change in HTML
 @param {formData} project - formData with encapsulated new projectName
Ajax function for renaming a project @param { url } url - to specify the user & project @param { String } pid - projectID - to help notifications and the corresponding change in HTML @param { formData } project - formData with encapsulated new projectName
// Make the new project name shown in UI