Skip to content

Commit

Permalink
build(root): ⬆️ updated to node 20
Browse files Browse the repository at this point in the history
  • Loading branch information
sahrohit committed Oct 28, 2023
1 parent 7a0db43 commit fd24c83
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18
v20
1 change: 0 additions & 1 deletion apps/api/.nvmrc

This file was deleted.

3 changes: 3 additions & 0 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,8 @@
"type-graphql": "2.0.0-beta.2",
"typeorm": "0.3.6",
"uuid": "^8.3.2"
},
"engines": {
"node": "20.x"
}
}
10 changes: 7 additions & 3 deletions apps/api/src/resolvers/invoice.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { COMPANY } from "../constants";
import { OrderDetail } from "../entities/OrderDetail";
import { Arg, Mutation, Resolver, UseMiddleware } from "type-graphql";
import easyinvoice from "easyinvoice";
import easyinvoice, { InvoiceData } from "easyinvoice";
import { sendEmailWithAttachment } from "../utils/sendEmail";
import { invoiceTemplate } from "../static/invoiceTemplate";
import { isAuth } from "../middlewares/isAuth";
Expand All @@ -13,7 +13,11 @@ export class InvoiceResolver {
async generateInvoice(
@Arg("orderId", () => String) orderId: string
): Promise<string> {
return (await easyinvoice.createInvoice(await getSampleData(orderId))).pdf;
return (
await easyinvoice.createInvoice(
(await getSampleData(orderId)) as InvoiceData
)
).pdf;
}

@Mutation(() => Boolean)
Expand All @@ -23,7 +27,7 @@ export class InvoiceResolver {
@Arg("email", () => String) email: string
): Promise<boolean> {
await easyinvoice.createInvoice(
await getSampleData(orderId),
(await getSampleData(orderId)) as InvoiceData,
async function (result) {
await sendEmailWithAttachment(
email,
Expand Down

0 comments on commit fd24c83

Please sign in to comment.