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