client side voting logic for posts