Compare commits

..

No commits in common. "04d9b8641929443e1d674619fa8bd11ccadbd6d4" and "6d0a62ec21acec8eebfeb1d88c4a0a9328f702e8" have entirely different histories.

View file

@ -30,9 +30,6 @@ export const CheckoutBookModal = ({
const onSubmit = useCallback( const onSubmit = useCallback(
async (data: Partial<BookCheckoutForm>) => { async (data: Partial<BookCheckoutForm>) => {
if (!formState.isValid) {
return;
}
if (!data.checkoutBy) { if (!data.checkoutBy) {
setError("checkoutBy", { setError("checkoutBy", {
message: `please enter ${ message: `please enter ${
@ -64,7 +61,7 @@ export const CheckoutBookModal = ({
setFailed(await res.text()); setFailed(await res.text());
} }
}, },
[formState.isValid, isChechout, uuid, setError, onClose] [uuid, onClose, setError, isChechout]
); );
return ( return (
@ -119,12 +116,6 @@ export const CheckoutBookModal = ({
"'null' is not a valid nickname" "'null' is not a valid nickname"
); );
}, },
notUndefinedString: (value) => {
return (
value?.toLocaleLowerCase() !== "undefined" ||
"'undefined' is not a valid nickname"
);
},
}, },
})} })}
isInvalid={!!formState.errors.checkoutBy} isInvalid={!!formState.errors.checkoutBy}
@ -193,7 +184,6 @@ export const CheckoutBookModal = ({
marginLeft: "auto", marginLeft: "auto",
marginRight: "10px", marginRight: "10px",
}} }}
disabled={!formState.isValid}
onClick={() => onSubmit(values)} onClick={() => onSubmit(values)}
> >
{`${isChechout ? "Checkout" : "Return"} book`} {`${isChechout ? "Checkout" : "Return"} book`}