$('.project-toggle-featured').on('click', function() {
    const projectId = $(this).data("project-id"),
          featured  = $(this).data("featured") === "True";
          method    =  featured ? "DELETE" : "POST";
    $.ajax({
          type: method,
          url: `/admin/featured/${projectId}`,
          dataType: 'json'
    }).done(() => {
        const newStatus = featured ? "False" : "True";
        $(this).data('featured', newStatus);
        $(this).html(newStatus);
    });
})
$('.project-toggle-featured').on('click', function() {
    const projectId = $(this).data("project-id"),
          featured  = $(this).val() === "Remove";
          method    =  featured ? "DELETE" : "POST";
    $.ajax({
          type: method,
          url: `/admin/featured/${projectId}`,
          dataType: 'json'
    }).done(() => {
        const newStatus = featured ? "Add" : "Remove";
        $(this).html(newStatus);
    });
})
Update featured projects button text
Update featured projects button text
