Skip to content

Commit

Permalink
fix: resolve build issue due to type-check errors
Browse files Browse the repository at this point in the history
Reference-to: #48, #49, #51
Signed-off-by: Prince Muel <[email protected]>
  • Loading branch information
princemuel committed May 11, 2023
1 parent 0b2f359 commit ac0e993
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/@types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 5 additions & 4 deletions src/components/organisms/edit-invoice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -291,7 +291,7 @@ const EditInvoiceForm = (props: Props) => {
Item List
</legend>

{/* @ts-expect-error */}
{/* @ts-expect-error ignore expected errorerror */}
<EditItemList methods={methods} invoice={invoice} />
</fieldset>
{/*<!--------- ITEM DETAILS END ---------!>*/}
Expand All @@ -309,6 +309,7 @@ const EditInvoiceForm = (props: Props) => {
<button
type='submit'
className='btn body-100 bg-brand-500 px-8 py-6 font-bold text-neutral-100'
disabled={!isSubmittable}
onClick={() => void setStatus('PENDING')}
>
Save Changes
Expand Down
7 changes: 4 additions & 3 deletions src/components/organisms/new-invoice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const NewInvoiceForm = (props: Props) => {
return () => {
subscription.unsubscribe();
};
}, [methods.watch]);
}, [methods]);

const { user } = useAuthState();
const navigate = useNavigate();
Expand Down Expand Up @@ -78,7 +78,7 @@ const NewInvoiceForm = (props: Props) => {
}

console.table(draft);
//@ts-expect-error
//@ts-expect-error ignore expected error
createInvoice({ input: draft });
methods.reset();
} catch (error) {
Expand Down Expand Up @@ -276,13 +276,14 @@ const NewInvoiceForm = (props: Props) => {
<button
type='submit'
className='btn body-100 bg-[#373B53] px-6 py-6 font-bold text-brand-300 hover:bg-brand-900'
disabled={!isSubmittable}
onClick={() => void setStatus('DRAFT')}
>
Save as draft
</button>
<button
type='submit'
// disabled={!isSubmittable}
disabled={!isSubmittable}
className='btn body-100 bg-brand-500 px-6 py-6 font-bold text-neutral-100 hover:bg-brand-200'
onClick={() => void setStatus('PENDING')}
>
Expand Down
4 changes: 2 additions & 2 deletions src/providers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const Providers = (props: Props) => {

queryCache: new QueryCache({
// onSuccess: (data) => {
// //@ts-expect-error
// //@ts-expect-error ignore expected error
// toast.success(data.message);
// },
onError: (error, query) => {
Expand All @@ -55,7 +55,7 @@ const Providers = (props: Props) => {
// configure global cache callbacks to show toast notifications
mutationCache: new MutationCache({
// onSuccess: (data) => {
// //@ts-expect-error
// //@ts-expect-error ignore expected error
// toast.success(data.message);
// },
onError: (error, variables, context, mutation) => {
Expand Down

1 comment on commit ac0e993

@vercel
Copy link

@vercel vercel bot commented on ac0e993 May 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

invoicemail – ./

invoicemail-git-main-princemuel.vercel.app
invoicemail-princemuel.vercel.app
invoicemail.vercel.app

Please sign in to comment.