This generally does not involve breaking the law. However, if you write your resume at the wrong time, the company may say that your resume is fake, deceptive and dishonest.
In this case, you can apply for labor arbitration to claim illegal termination and demand double indemnity.