Is there an open database which lists FDA or EMA approvals of drugs for the treatment of specific illnesses?
Not sure exactly what the question is here.. Yes, openFDA is a database that is free to use, has it's source code on github, and can be queried to find drugs for specific treatments. Part of the api query has a field called "purpose" that should be what you are looking for.
You can use Drugs@FDA database: https://www.accessdata.fda.gov/scripts/cder/drugsatfda/index.cfm.