console.log("info12")
$(document).ready(function () {
    console.log("info1")
    $('#profileInfo').on('click', function (e) {
        e.preventDefault();
        console.log("info2");
        var userId = $('#user_id').val();
        console.log('User ID:', userId);

        $.ajax({
            url: '/get-personal-info/' + userId ,
            type: 'GET',
            dataType: 'json',
            success: function (data) {
                $('#edit_name').val(data.NAME);
                $('#edit_display').val(data.NAME);
                $('#edit_email').val(data.EMAIL_ID);

                console.log('Profile data:', data);
            },
            error: function (xhr, status, error) {
                console.error('Failed to fetch user data:', error);
            }
        });
    });
});
