Close the main stopcock first. That stops more water coming in.
Switch off the electricity in the affected rooms if water is near sockets or appliances.
Record the damage with photos and tell your insurer before you clear up.
Remove the water and air the rooms well. If damp stays in walls or floors, mould follows quickly.
More about mould on Mallorca