Answered by Shaykh Faraz Rabbani
If someone has some nasal congestion and swallows it while fasting, does that break the fast? If it does and the person is required to spit it out instead, what if he is a teacher and would have to leave the classroom every couple of minutes to spit?

Walaikum assalam wa rahmatullah,
I pray that this finds you well, and in the best of health and spirits. May Allah grant you all good and success in this life and the next.
Swallowing phlegm doesn’t affect the fast. However, it is recommended (but not obligatory) to spit out phlegm that reaches the mouth in order to avoid differences of opinion, when one can do so without difficulty or hardship. [Shurunbulali, Maraqi al-Falah]
And Allah alone gives success.
Faraz Rabbani