Hello yogisuzi,
That's amazing that your iPhone 12 survived but be on the lookout. Symptoms from water damage may not show right away. Like my iPhone XR got water damaged and like a day later it turned off randomly and overheated real fast. But, iPhone XR is fine now! :)
Incase you see symptoms of water damage, send it to your local Apple Store. There's a water damage indicator in your iPhone, for more information, go here: Water and other liquid damage to iPhone or iPod isn't covered by warranty - Apple Support.
If you see a liquid-detection popup, read this: If you see a liquid-detection alert on your iPhone - Apple Support.
⚠️: Accidental damage, water damage, or cosmetic damage is not covered by warranty, for more info, go here: iPhone Repair - Official Apple Support.
Sincerely,
Jay :)