-
Notifications
You must be signed in to change notification settings - Fork 59
Fix/mm2 1209: Fix TS errors part 1 #188
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| } from "../../../../../lib/data/currencies" | ||
|
|
||
| export const CreateCampaignFormFields = ({ form, fieldScope = "" }) => { | ||
| export const CreateCampaignFormFields = ({ form, fieldScope = "" }: { form:any, fieldScope: 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.
could we not use 'any' here?
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.
Fixed, I created helper types to handle forms using this fields component
| if (!id) { | ||
| throw new Error("Customer ID is required") | ||
| } | ||
|
|
||
| const { customer, isPending, isError, error } = useCustomer(id) | ||
| const { mutateAsync, isPending: isMutating } = useUpdateCustomer(id) |
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.
not sure about this - aren't we using hook conditionally in this case? how about passing {enabled: !!id}
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.
Removed everywhere 👍 you're right
| if (!id) { | ||
| throw new Error("Inventory Item ID is required") | ||
| } | ||
|
|
||
| const { inventory_item, isPending, isError, error } = useInventoryItem(id) |
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.
as above - conditional hook usage
| }) | ||
|
|
||
| const { mutateAsync, isLoading } = {} | ||
| const { mutateAsync, isLoading }: { mutateAsync?: any; isLoading?: boolean } = {} |
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.
do we have to use this 'any' here?
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.
The component isn't used anywhere and looks like placeholder for future use, we don't have API to handle order note either. Leaving it with any + comment why
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.
so please check if this could be deleted
…nd currency value
MM2-1279