Uti while pregnant?

Did anyone else get a UTI while pregnant??? Did you takes the medicine to cure it? It’s safe to do so?