Trump's endorsements shaped the Republican field, but the midterms tested the limits of his influence.