GoalModelEditor/FrontEnd/public/js/dashboard.js
/**
 * Ajax function for creating a project
 *
 * @param {formData} project - formData with encapsulated projectName
 */
Ajax function for creating a project
@param {formData} project - formData with encapsulated projectName
Ajax function for creating a project @param { formData } project - formData with encapsulated projectName
function createProject(project) {
    $.ajax(POST_PROJECT_URL, {
        data: project,
        type: "POST",
        headers: { Authorization: "Bearer " + TOKEN },
        success: newProject => {
            let projectHTML = parseProject(newProject);
            $("#projects-container").append(projectHTML);
            successMessageSlide("Project: " + newProject.project_name + " successfully created.");
            removeCustomizedEventListeners();
            addListenersToNewItem();
            $("#add-project .modal-body input").val("");
            $("#add_" + newProject.project_id).popover('toggle');
            $(".overlay").show();
        }
    }).fail(function(jqXHR) {
        warningMessageSlide(jqXHR.responseJSON.message + "<br>Please try again.");
    });
}
function createProject ( project ) { $ . ajax ( POST_PROJECT_URL , { data : project , type : "POST" , headers : { Authorization : "Bearer " + TOKEN } , success : newProject => { let projectHTML = parseProject ( newProject ) ; $ ( "#projects-container" ) . append ( projectHTML ) ; successMessageSlide ( "Project: " + newProject . project_name + " successfully created." ) ; removeCustomizedEventListeners ( ) ; addListenersToNewItem ( ) ; $ ( "#add-project .modal-body input" ) . val ( "" ) ; $ ( "#add_" + newProject . project_id ) . popover ( 'toggle' ) ; $ ( ".overlay" ) . show ( ) ; } } ) . fail ( function ( jqXHR ) { warningMessageSlide ( jqXHR . responseJSON . message + "<br>Please try again." ) ; } ) ; }
Ajax function for creating a project
 @param {formData} project - formData with encapsulated projectName
Ajax function for creating a project @param { formData } project - formData with encapsulated projectName
// Append the project to current UI // add Listeners // Re-initialize the input for the modal // Instructions to add models