Help! Constipated baby

My little one is 8 weeks old and is only fed breast milk through bottle and I breastfeed her when I’m not working. Recently she just stopped pooping and constantly kicks and screams like she is in pain. She toots but no poops :( it’s been a week and I took her to the doctor and they just told me to stop eating dairy. Anyone else gone through this? I feel bad she is in pain