fix: change path download template and add template pariwisata

This commit is contained in:
2025-02-20 10:36:56 +07:00
parent f10bc153b4
commit dcd93d66e2
6 changed files with 20 additions and 4 deletions

View File

@@ -88,7 +88,7 @@ dropzone.on("complete", function(file) {
// Add event listener to download file template
document.getElementById('downloadtemptourisms').addEventListener('click', function() {
var url = `${GlobalConfig.apiHost}/api/download-template-umkm`;
var url = `${GlobalConfig.apiHost}/api/download-template-tourism`;
fetch(url, {
method: 'GET',
headers: {
@@ -105,11 +105,12 @@ document.getElementById('downloadtemptourisms').addEventListener('click', functi
}
})
.then((blob) => {
console.log(blob);
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.style.display = 'none';
a.href = url;
a.download = 'template_tourisms.xlsx';
a.download = 'template_pariwisata.xlsx';
document.body.appendChild(a);
a.click();
window.URL.revokeObjectURL(url);