US President-elect Donald Trump had two criminal cases against him abandoned.