IF statements in RPC - Supabase