From ac0e9932bed474183e8fb404c7a7d972b6145ef3 Mon Sep 17 00:00:00 2001 From: Prince Muel Date: Thu, 11 May 2023 16:56:05 +0100 Subject: [PATCH] fix: resolve build issue due to type-check errors Reference-to: #48, #49, #51 Signed-off-by: Prince Muel --- src/@types/index.d.ts | 2 +- src/components/organisms/edit-invoice.tsx | 9 +++++---- src/components/organisms/new-invoice.tsx | 7 ++++--- src/providers/index.tsx | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/@types/index.d.ts b/src/@types/index.d.ts index 66cff5a..2560f76 100644 --- a/src/@types/index.d.ts +++ b/src/@types/index.d.ts @@ -86,7 +86,7 @@ export declare namespace Project { clientEmail: string; clientName: string; description: string; - items: ILineItem[]; + items: [ILineItem, ...ILineItem[]]; senderAddress: IAddress; issueDate?: string | undefined; paymentDue?: string | undefined; diff --git a/src/components/organisms/edit-invoice.tsx b/src/components/organisms/edit-invoice.tsx index 864ff65..c421ad4 100644 --- a/src/components/organisms/edit-invoice.tsx +++ b/src/components/organisms/edit-invoice.tsx @@ -80,7 +80,7 @@ const EditInvoiceForm = (props: Props) => { country: invoice?.senderAddress?.country || '', postCode: invoice?.senderAddress?.postCode || '', }, - //@ts-expect-error + //@ts-expect-error ignore expected error status: invoice?.status || 'PENDING', total: invoice?.total || 0, }, @@ -97,7 +97,7 @@ const EditInvoiceForm = (props: Props) => { const dueTime = selectedDate.valueOf() + duration; draft.paymentDue = new Date(dueTime).toISOString(); - //@ts-expect-error + //@ts-expect-error ignore expected error draft.status = status; for (const item of draft?.items) { @@ -113,7 +113,7 @@ const EditInvoiceForm = (props: Props) => { throw new Error(JSON.stringify(result.error)); } - // @ts-expect-error + //@ts-expect-error ignore expected error updateInvoice({ input: draft, where: { id: invoiceId } }); methods.reset(); } catch (error) { @@ -291,7 +291,7 @@ const EditInvoiceForm = (props: Props) => { Item List - {/* @ts-expect-error */} + {/* @ts-expect-error ignore expected errorerror */} {/**/} @@ -309,6 +309,7 @@ const EditInvoiceForm = (props: Props) => {