{"version":3,"file":"axios_helpers-BCh3k45p.js","sources":["../../../app/javascript/helpers/axios_helpers.js"],"sourcesContent":["import axios from \"axios\"\n\nconst axiosHelpers = {\n downloadFile({ url, method, filename } = { method: \"GET\" }) {\n return axios({\n url: url,\n method: method,\n responseType: \"blob\", // important\n }).then((response) => {\n const url = window.URL.createObjectURL(new Blob([response.data]))\n const link = document.createElement(\"a\")\n link.href = url\n link.setAttribute(\"download\", filename) //or any other extension\n document.body.appendChild(link)\n link.click()\n })\n },\n}\n\nexport default axiosHelpers\n"],"names":["axiosHelpers","url","method","filename","axios","response","link"],"mappings":"yaAEK,MAACA,EAAe,CACnB,aAAa,CAAE,IAAAC,EAAK,OAAAC,EAAQ,SAAAC,CAAQ,EAAK,CAAE,OAAQ,OAAS,CAC1D,OAAOC,EAAM,CACX,IAAKH,EACL,OAAQC,EACR,aAAc,MACpB,CAAK,EAAE,KAAMG,GAAa,CACpB,MAAMJ,EAAM,OAAO,IAAI,gBAAgB,IAAI,KAAK,CAACI,EAAS,IAAI,CAAC,CAAC,EAC1DC,EAAO,SAAS,cAAc,GAAG,EACvCA,EAAK,KAAOL,EACZK,EAAK,aAAa,WAAYH,CAAQ,EACtC,SAAS,KAAK,YAAYG,CAAI,EAC9BA,EAAK,MAAK,CACX,CAAA,CACF,CACH"}