fix: CSV has wrong file extension (#19)

* Update v1_ctrl_reporting.go

Amend BOM export to CSV

* Update v1_ctrl_reporting.go

---------

Co-authored-by: Matt Kilgore <tankerkiller125@gmail.com>
This commit is contained in:
Katos
2024-06-19 00:28:33 +01:00
committed by GitHub
parent 0980ee41cf
commit 2111ee182d

View File

@@ -2,7 +2,6 @@ package v1
import (
"net/http"
"github.com/hay-kot/httpkit/errchain"
"github.com/sysadminsmedia/homebox/backend/internal/core/services"
)
@@ -24,8 +23,8 @@ func (ctrl *V1Controller) HandleBillOfMaterialsExport() errchain.HandlerFunc {
return err
}
w.Header().Set("Content-Type", "text/tsv")
w.Header().Set("Content-Disposition", "attachment; filename=bill-of-materials.tsv")
w.Header().Set("Content-Type", "text/csv")
w.Header().Set("Content-Disposition", "attachment; filename=bill-of-materials.csv")
_, err = w.Write(csv)
return err
}