GoalModelEditor/FrontEnd/public/js/dashboard.js
/**
 * Ajax function for retrieving all projects
 */
Ajax function for retrieving all projects
Ajax function for retrieving all projects
function retriveProjects() {
    $.ajax(GET_PROJECT_URL, {
        type: "GET",
        headers: { Authorization: "Bearer " + TOKEN },
        success: projects => {
            setUserName(UNAME);
            for (let i in projects.projects) {
                let projectHTML = parseProject(projects.projects[i]);
                $("#projects-container").append(projectHTML);
            }
            removeCustomizedEventListeners();
            addListenersToNewItem();
        }
    }).fail(function (jqXHR) {
        warningMessageSlide(
            jqXHR.responseJSON.message + "<br>Please try again."
        );
    });
}
function retriveProjects ( ) { $ . ajax ( GET_PROJECT_URL , { type : "GET" , headers : { Authorization : "Bearer " + TOKEN } , success : projects => { setUserName ( UNAME ) ; for ( let i in projects . projects ) { let projectHTML = parseProject ( projects . projects [ i ] ) ; $ ( "#projects-container" ) . append ( projectHTML ) ; } removeCustomizedEventListeners ( ) ; addListenersToNewItem ( ) ; } } ) . fail ( function ( jqXHR ) { warningMessageSlide ( jqXHR . responseJSON . message + "<br>Please try again." ) ; } ) ; }
Ajax function for retrieving all projects
Ajax function for retrieving all projects
// Start Retrieving all projects and the associated goal models for the current user // Set the username // Append the projects to current UI // Add listeners