Thrush medicine is making my baby miserable! Help!!!

Ash • Married 8.2.2014. 1st Boy 11.24.16. 2nd Boy 8.27.18
My almost 4 week old got thrush from an antibiotic I was on. I'm breastfeeding. So he has thrush in his mouth and I have it on my nipples. We don't even need to talk about the pain that I'm dealing with in my nipples and breasts. 😑 but thrush and the nystatin oral ointment is making my baby so gassy and miserable! Every day he is sleeping less and crying more. Worst part is, it's been a week and there's been no improvement for either of us. What do I do?? I'm going crazy! He slept 3 hours last night, TOTAL! I don't know what to do.