The judge, who was appointed by former president Barack Obama, gave Trump the opportunity to amend his complaint and refile the suit by 27 April.