UTI 😭

I've got no symptoms, but my doctor just called to tell me I have one. They're prescribing me antibiotics that are apparently safe to take while pregnant. I didnt know that was a thing. I just thought if you were pregnant and got a UTI the only safe thing to use do treat it was cranberry juice? Anyone else in the same boat?