Skip to content

Commit 5013e81

Browse files
committed
put all the init code in onModuleInit
1 parent 95558ff commit 5013e81

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/jsreport/jsreport.service.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type JsReportResult = JsReport.Response & {
2929
export class JsReportService implements OnModuleInit {
3030
private jsreport: JsReport.Reporter;
3131

32-
constructor() {
32+
async onModuleInit() {
3333
this.jsreport = require('@jsreport/jsreport-core')({
3434
sandbox: { allowedModules: '*' },
3535
rootDirectory: __dirname,
@@ -40,9 +40,6 @@ export class JsReportService implements OnModuleInit {
4040
},
4141
},
4242
});
43-
}
44-
45-
async onModuleInit() {
4643
this.jsreport.use(require('@jsreport/jsreport-xlsx')());
4744
this.jsreport.use(require('@jsreport/jsreport-html-to-xlsx')());
4845
this.jsreport.use(require(`@jsreport/jsreport-docx`)());

0 commit comments

Comments
 (0)