@@ -63,7 +63,7 @@ func (app *application) postEquipmentImport(w http.ResponseWriter, r *http.Reque
6363
6464 rawRows , parseErr := parseImportCSV (f )
6565 if parseErr != "" {
66- return reRender ("Failed to parse CSV." )
66+ return reRender (parseErr )
6767 }
6868
6969 importID , err := app .services .equipmentImports .Stage (ctx , orgID , rawRows )
@@ -125,9 +125,9 @@ func (app *application) postEquipmentImportConfirm(w http.ResponseWriter, r *htt
125125 return nil
126126}
127127
128- const importTemplateCSV = "Name,Type,Usage,Category,Manufacturer,Location,Rental Price,Resale Price,Notes,Weight (g ),Width (mm ),Height (mm ),Depth (mm ),Voltage (V),Current (mA ),Power (mW ),Wire Gauge (mm² ×100),Quantity\n " +
129- "Shure SM58,Bulk,Rental,Audio,Shure,Main Warehouse,15.00,99.00,Cardioid dynamic vocal microphone,298,47,47,162 ,,,,,7\n " +
130- "Sony SRS-XB43,Serialized,Rental,Audio,Sony,Main Warehouse,25.00,180.00,Portable Bluetooth speaker with extra bass,900,220,220,95 ,5,2400,12000 ,,4\n "
128+ const importTemplateCSV = "Name,Type,Usage,Category,Manufacturer,Location,Rental Price,Resale Price,Notes,Weight (kg ),Width (cm ),Height (cm ),Depth (cm ),Voltage (V),Current (A ),Power (W ),Wire Gauge (mm² ×100),Quantity\n " +
129+ "Shure SM58,Bulk,Rental,Audio,Shure,Main Warehouse,15.00,99.00,Cardioid dynamic vocal microphone,0. 298,4.7,4.7,16.2 ,,,,,7\n " +
130+ "Sony SRS-XB43,Serialized,Rental,Audio,Sony,Main Warehouse,25.00,180.00,Portable Bluetooth speaker with extra bass,0.9,22,22,9.5 ,5,2.4,12 ,,4\n "
131131
132132// getEquipmentImportTemplate serves a ready-to-fill CSV template for download.
133133func (app * application ) getEquipmentImportTemplate (w http.ResponseWriter , _ * http.Request ) * httperr.Error {
@@ -199,8 +199,8 @@ func readImportRows(cr *csv.Reader) ([]imports.RawRow, string) {
199199 HeightMm : strings .TrimSpace (record [11 ]),
200200 DepthMm : strings .TrimSpace (record [12 ]),
201201 VoltageV : strings .TrimSpace (record [13 ]),
202- CurrentMa : strings .TrimSpace (record [14 ]),
203- PowerMw : strings .TrimSpace (record [15 ]),
202+ CurrentA : strings .TrimSpace (record [14 ]),
203+ PowerW : strings .TrimSpace (record [15 ]),
204204 WireGaugeMM2X100 : strings .TrimSpace (record [16 ]),
205205 Quantity : strings .TrimSpace (record [17 ]),
206206 })
0 commit comments