It certainly influenced the election and undermined the judiciary, but I'm not sure it undermined democracy.
The process has design features to specifically allow it to function even when run by corrupt people. That was the entire point, since the beginning.