Customers Display Tickets

yes please check

<!DOCTYPE html>
<html>

<head>
      <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js'></script>
    <script src='http://ajax.aspnetcdn.com/ajax/signalr/jquery.signalr-2.2.0.min.js'></script>
    <script src="/signalr/hubs"></script>
    <script>
$.postJSON = function(url, data, callback) {
    return jQuery.ajax({
    'type': 'POST',
    'url': url,
    'contentType': 'application/json',
    'data': JSON.stringify(data),
    'headers': {'Authorization': ''},

    'dataType': 'json',
    'success': callback
    });
};
    
$(document).ready(function(){
    $('#header').html('<b>SambaPOS</b> Todo List');
    $('#btnAdd').click(function(){
        var item = $('#todoEdit').val();
        $('#todoList').append('<li>'+item+'</li>');
    });
    updateTasks();
    
     var proxy = $.connection.default;
    proxy.client.update = function (message) {
        updateTasks();
    };
    $.connection.hub.start()
        .done(function(){ console.log('Now connected, connection ID=' + $.connection.hub.id); })
        .fail(function(){ console.log('Could not Connect!'); });
});

function updateTasks(){
    var query = getTaskScript();
    $.postJSON("/api/graphql/", {query: query}, function(response) {
        if (response.errors) {
            // handle errors
        } else {            
            // //es6 syntax
            // response.data.tasks.forEach(task=> {
            //     $('#todoList').append(`<li>${task.content}</li>`);
            // });
            $("#todoList").empty();            
            for (index = 0; index < response.data.tasks.length; ++index) {
                var task = response.data.tasks[index];
                $('#todoList').append('<li>'+task.content+'</li>');
            };
        }
    });
}

function getTaskScript(){
    return '{tasks:getTasks(taskType:"Open Drawer Log",isCompleted:false){content}}';
}
</script>
</head>

<body>
    <p id='header'>Tooo List</p>
    <p>
        Todo: <input type='text' id='todoEdit'>
        <button id='btnAdd'>Add</button>
    </p>
    <p>
        <ul id='todoList'>
            <ul>
    </p>
</body>

</html>

@Jesse Hi, Can you please guide me when you got time, thanks

Jesse -

This code starts connection to message server and logs if it successfully connected or not. You’ll notice the function assigned to proxy.client.update works when we receive a message. For now we’ll just update task list on whatever message we receive from SambaPOS.

What would the function be if you wanted this to trigger upon a specific message? Or can you suggest a resource where I could research?