Improve vehicles management

This commit is contained in:
2022-11-07 01:24:16 +01:00
parent dc53589e7d
commit 58f5a23d1d
15 changed files with 261 additions and 64 deletions

View File

@@ -59,15 +59,11 @@ func (h APIHandler) CacheExport(w http.ResponseWriter, r *http.Request) {
//fmt.Println(data)
for _, v := range data {
fmt.Println(v)
fm := map[string]any{}
flatten("", v.(map[string]any), fm)
fmt.Println(fm)
flatmaps = append(flatmaps, fm)
}
fmt.Println(flatmaps)
w.Header().Set("Content-Type", "text/csv")
w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=export-%s.csv", cacheid))
c := csv.NewWriter(w)