GoalModelEditor/FrontEnd/public/js/dashboard.js
/**
 * Ajax function for deleting a project
 *
 * @param {url} url - to specify the user & project
 * @param {String} pid - projectID - to help delete the project in HTML
 * @param {formData} project - formData with encapsulated project to be deleted
 */
Ajax function for deleting a project
@param {url} url - to specify the user & project
@param {String} pid - projectID - to help delete the project in HTML
@param {formData} project - formData with encapsulated project to be deleted
Ajax function for deleting a project @param { url } url - to specify the user & project @param { String } pid - projectID - to help delete the project in HTML @param { formData } project - formData with encapsulated project to be deleted
function deleteProject(url, pid, project) {
    $.ajax(url, {
        data: project,
        type: "DELETE",
        headers: { Authorization: "Bearer " + TOKEN },
        success: () => {
            successMessageSlide(
                "Project: " +
                $("#" + pid).find(".project_name").eq(0).html() +
                    " successfully deleted."
            );
            $("#" + pid).hide();
        }
    }).fail(function(jqXHR) {
        warningMessageSlide(jqXHR.responseJSON.message + "<br>Please try again.");
    });
}
function deleteProject ( url , pid , project ) { $ . ajax ( url , { data : project , type : "DELETE" , headers : { Authorization : "Bearer " + TOKEN } , success : ( ) => { successMessageSlide ( "Project: " + $ ( "#" + pid ) . find ( ".project_name" ) . eq ( 0 ) . html ( ) + " successfully deleted." ) ; $ ( "#" + pid ) . hide ( ) ; } } ) . fail ( function ( jqXHR ) { warningMessageSlide ( jqXHR . responseJSON . message + "<br>Please try again." ) ; } ) ; }
Ajax function for deleting a project
 @param {url} url - to specify the user & project
 @param {String} pid - projectID - to help delete the project in HTML
 @param {formData} project - formData with encapsulated project to be deleted
Ajax function for deleting a project @param { url } url - to specify the user & project @param { String } pid - projectID - to help delete the project in HTML @param { formData } project - formData with encapsulated project to be deleted
// Hide the corresponding HTML