Before the current catastrophe, Andrew Jackson was the president who in 1827 really threw weight into patronage, what we now refer to as the "spoils system" (from to the victor belong the spoils), removing long-time bureaucrats in favor of Jackson's own Democratic (then conservative) party operatives.
Already a corruption of the public will and a waste of public funds, by 1871 the spoils system had become so nakedly crooked that Congress passed and President Grant signed the law creating a civil service commission, but Republicans (then the liberal party) in the House refused to fund it. James Garfield ran for president in 1880 on a platform of civil service reform and won, but ironically was assassinated by an unhappy office seeker.
Partially as a result of the assassination, Garfield's vice president Chester Arthur was able to get the Pendleton Civil Service Reform Act passed in 1883, requiring applicants to pass examinations to determine relatively competency among them. After Nixon's resignation for corruption, a largely conservative Democratic congress passed the Civil Service Reform Act of 1978, establishing what sanity the system had before the wrecking ball which is Drumpf came into office.