function incrementCounter(data) {
  const ticketIdentifier = `ticket_${data.ticket.id}`;

  client.db.get(ticketIdentifier).then(function(activityData) {
    ++activityData.visits;

    notify('info', 'Tacking activity for old Ticket');

    client.db.set(ticketIdentifier, activityData);

  }, function(error) {
    if (error.status === 404) {
      notify('info', 'Tacking activity for new Ticket');
      client.db.set(ticketIdentifier, {
        visits: 1
      });
    }
  })
}
/**
 * Increment the visits for the current ticket
 */
Increment the visits for the current ticket
Increment the visits for the current ticket
function incrementCounter(data) {
  const ticketIdentifier = `ticket_${data.ticket.id}`;
  client.db.get(ticketIdentifier).then(function(activityData) {
    ++activityData.visits;
    notify('info', 'Tacking activity for old Ticket');
    client.db.set(ticketIdentifier, activityData);
  }, function(error) {
    if (error.status === 404) {
      notify('info', 'Tacking activity for new Ticket');
      client.db.set(ticketIdentifier, {
        visits: 1
      });
    }
  })
}
function incrementCounter ( data ) { const ticketIdentifier = ` ${ data . ticket . id } ` ; client . db . get ( ticketIdentifier ) . then ( function ( activityData ) { ++ activityData . visits ; notify ( 'info' , 'Tacking activity for old Ticket' ) ; client . db . set ( ticketIdentifier , activityData ) ; } , function ( error ) { if ( error . status === 404 ) { notify ( 'info' , 'Tacking activity for new Ticket' ) ; client . db . set ( ticketIdentifier , { visits : 1 } ) ; } } ) }
Increment the visits for the current ticket
Increment the visits for the current ticket