Hello dear colleagues
I have created this api.py file => my-url/api/method/erpnext.api.test and it is working fine with postman but gives CORS error whenever I try to use it in my web application
Sample code:
import frappe
@frappe.whitelist(allow_guest=True)
def get_invoices():
return frappe.db.sql(f"""select * from `tabSales Invoice` where 1;""", as_dict=True)
Well i just forgot to mention that but it is defined already in site_config:
“allow_cors”: “*”
and it is working for the built-in api end points