From fd24c83b5814e207cfb35daf0564ee96484f0b48 Mon Sep 17 00:00:00 2001 From: Rohit Sah Date: Sat, 28 Oct 2023 18:21:57 +0545 Subject: [PATCH] build(root): :arrow_up: updated to node 20 --- .node-version | 2 +- apps/api/.nvmrc | 1 - apps/api/package.json | 3 +++ apps/api/src/resolvers/invoice.ts | 10 +++++++--- 4 files changed, 11 insertions(+), 5 deletions(-) delete mode 100644 apps/api/.nvmrc diff --git a/.node-version b/.node-version index 0828ab7..85aee5a 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -v18 \ No newline at end of file +v20 \ No newline at end of file diff --git a/apps/api/.nvmrc b/apps/api/.nvmrc deleted file mode 100644 index b1215e8..0000000 --- a/apps/api/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -v18.16.0 \ No newline at end of file diff --git a/apps/api/package.json b/apps/api/package.json index ca05c08..3434db2 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -63,5 +63,8 @@ "type-graphql": "2.0.0-beta.2", "typeorm": "0.3.6", "uuid": "^8.3.2" + }, + "engines": { + "node": "20.x" } } diff --git a/apps/api/src/resolvers/invoice.ts b/apps/api/src/resolvers/invoice.ts index a7bf7b2..bbad237 100644 --- a/apps/api/src/resolvers/invoice.ts +++ b/apps/api/src/resolvers/invoice.ts @@ -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"; @@ -13,7 +13,11 @@ export class InvoiceResolver { async generateInvoice( @Arg("orderId", () => String) orderId: string ): Promise { - return (await easyinvoice.createInvoice(await getSampleData(orderId))).pdf; + return ( + await easyinvoice.createInvoice( + (await getSampleData(orderId)) as InvoiceData + ) + ).pdf; } @Mutation(() => Boolean) @@ -23,7 +27,7 @@ export class InvoiceResolver { @Arg("email", () => String) email: string ): Promise { await easyinvoice.createInvoice( - await getSampleData(orderId), + (await getSampleData(orderId)) as InvoiceData, async function (result) { await sendEmailWithAttachment( email,