I want do download a CSV with the click of a link.
My endpoint is a 'POST' and since I'm unable to do it directly with the <a> tag, I wrapped it in a form.
This is my code:
<form method="post" action="/api/summary?type=download&limit=all">
<a onclick="this.parentNode.submit()" class="download-sumary" download>Download</a>
</form>
The endpoint returns the response correctly, but the download is not working.
Can I use the download attribute on an anchor inside a form? If not, how can I achieve this?
PS: The CSV is being created in the back-end