Trump has privately expressed frustration that the conflict damaged Republican chances in the midterms.