Skip to content

Commit

Permalink
fix download file responseType
Browse files Browse the repository at this point in the history
  • Loading branch information
faris-isa committed May 10, 2021
1 parent de99a0a commit 1d4483f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/views/dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ const Dashboard = () => {

const handleDownload = (event) => {
try {
let config = { headers : {
let config = {
responseType: 'blob',
headers : {
Authorization: `Bearer ${token}`,
}};
axiosConfig.get(`/graphs/export`, config)
Expand Down
3 changes: 2 additions & 1 deletion src/views/offers/Offer.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ const Offer = ({match}) => {

const handleDownload = (id, nama_pembeli) => {
try {
let config = { headers : {
let config = {
responseType: 'blob',
headers : {
Authorization: `Bearer ${token}`,
}};
axiosConfig.get(`/offers/export/${id}`, config)
Expand Down
3 changes: 2 additions & 1 deletion src/views/offers/OffersAcc.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ const OffersAcc = () => {

const handleDownload = (id, nama_pembeli) => {
try {
let config = { headers : {
let config = {
responseType: 'blob',
headers : {
Authorization: `Bearer ${token}`,
}};
axiosConfig.get(`/offers/export/${id}`, config)
Expand Down

0 comments on commit 1d4483f

Please sign in to comment.