-
Notifications
You must be signed in to change notification settings - Fork 8
MM2-1281: Fix TS errors pt 1 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: testing
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| type ExtendedAdminOrderFilters = HttpTypes.AdminOrderFilters & { | ||
| fulfillment_status?: string[] | ||
| payment_status?: string[] | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about moving this definition to src/types?
| type ExtendedAdminProductListParams = HttpTypes.AdminProductListParams & { | ||
| tag_id?: string[] | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about moving this definition to src/types?
|
|
||
| const handleSubmit = async ( | ||
| params: { metadata?: Record<string, unknown> | null }, | ||
| callbacks: { onSuccess: () => void; onError: (error: FetchError | string) => void } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO onSuccess and onError should be optional - what do you think? (applies to all occurrences of this typing)
| first_name: data.first_name || undefined, | ||
| last_name: data.last_name || undefined, | ||
| phone: data.phone || undefined, | ||
| company_name: data.company_name || undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... || undefined seems uncorrect because left value must be undefined to apply this condition
|
|
||
| const onDuplicate = async () => { | ||
| if (!item.variant_id) { | ||
| toast.error("Cannot duplicate item: variant ID is missing") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i18n please
| const inventoryItemId = params.get("item_id") | ||
|
|
||
| if (!inventoryItemId) { | ||
| throw new Error("Inventory item ID is required") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i18n please
Link to ticket: MM2-1437