Skip to content

Commit

Permalink
xlsx version upgraded (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeknovy authored Jan 22, 2024
1 parent b050d77 commit b1dcbb0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 92 deletions.
92 changes: 5 additions & 87 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"swagger-ui-express": "^4.6.3",
"uuid": "^9.0.1",
"winston": "^3.10.0",
"xlsx": "^0.18.5"
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.1/xlsx-0.20.1.tgz"
},
"devDependencies": {
"@types/boom": "^7.2.0",
Expand Down
1 change: 1 addition & 0 deletions src/server/routes/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class ItemsRoutes {
projectExistsMiddleware,
wrapAsync((req: Request, res: Response) => deleteItemController(req, res)))

// https://github.com/ludeknovy/jtl-reporter/issues/159
app.route("/api/projects/:projectName/scenarios/:scenarioName/items/:itemId/request-stats-export")
.get(
authenticationMiddleware,
Expand Down
7 changes: 3 additions & 4 deletions src/server/utils/excel-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ export class ExcelService {


static generateExcelBuffer(json: unknown[]): string {
const myworksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json)
const myworkbook: XLSX.WorkBook = { Sheets: { data: myworksheet }, SheetNames: ["data"] }
return XLSX.write(myworkbook, { bookType: "xlsx", bookSST: false, type: "base64" })
const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json)
const workbook: XLSX.WorkBook = { Sheets: { data: worksheet }, SheetNames: ["data"] }
return XLSX.write(workbook, { bookType: "xlsx", bookSST: false, type: "base64" })
}

}

0 comments on commit b1dcbb0

Please sign in to comment.