feat: add tsv support for import files (#160)

* feat: add tsv support for import files

* add note in docs
This commit is contained in:
Hayden
2022-12-01 18:06:47 -09:00
committed by GitHub
parent f149c3e4ab
commit f42a917390
7 changed files with 116 additions and 13 deletions

View File

@@ -1,7 +1,6 @@
package v1
import (
"encoding/csv"
"net/http"
"github.com/hay-kot/homebox/backend/internal/core/services"
@@ -178,8 +177,7 @@ func (ctrl *V1Controller) HandleItemsImport() server.HandlerFunc {
return validate.NewRequestError(err, http.StatusInternalServerError)
}
reader := csv.NewReader(file)
data, err := reader.ReadAll()
data, err := services.ReadCsv(file)
if err != nil {
log.Err(err).Msg("failed to read csv")
return validate.NewRequestError(err, http.StatusInternalServerError)