

$(document).ready(function () {
    $('#logout-link').on('click', function (e) {
        e.preventDefault();
        $.ajax({
            url: '/user-logout',
            type: 'POST',
            success: function () {
                console.log('Logout successful');
                window.location.href = '';
            },
            error: function (xhr, status, error) {
                console.error('Logout failed:', error);
            }
        });
    });
});