All they needed was to show a little restraint instead of giving in to their revenge instinct. China and Russia are both hostile to Islamic terrorism. Nobody would have vetoed that resolution if Israel hasn't started immediately flattening Gaza.
That is actually how Hamas would have lost its leg.