feat(BE-281): change template excel

This commit is contained in:
ragilap
2025-12-29 19:44:10 +07:00
parent a2066979c1
commit 6523290aaf
2 changed files with 6 additions and 1 deletions
Binary file not shown.
@@ -49,7 +49,12 @@ func parseBodyWeightExcelReader(reader io.Reader) ([]BodyWeightExcelRow, error)
return nil, fiber.NewError(fiber.StatusBadRequest, "no sheets found in file")
}
rows, err := xlsx.GetRows(sheets[0], excelize.Options{RawCellValue: true})
sheetName := sheets[0]
if len(sheets) > 1 {
sheetName = sheets[1]
}
rows, err := xlsx.GetRows(sheetName, excelize.Options{RawCellValue: true})
if err != nil {
return nil, fiber.NewError(fiber.StatusBadRequest, "failed to read sheet rows")
}