Unfortunately, it's completely legal, assuming that you did not have an employment contract. (The vast majority of people do not.) That's because in the absence of an employment contract, you are an employee at will, and may be fired at any time, for any reason--including that the father of your child was fired from that employer.