Anyone get a UTI and take antibiotics right when you found out you were pregnant?

I’m nervous to take an antibiotic at just 4 weeks. Did everything turn out okay if you had to do this?