Refactor validation schema by renaming 'comments' to 'comment' in InitiateReversalPopup component

This commit is contained in:
Swapnil Bendal
2025-01-17 19:08:29 +05:30
parent 0ccfba1238
commit fba6a7ad45

View File

@@ -46,8 +46,6 @@ const InitiateReversalPopup = ({
mode: "all",
});
console.log(isLoading);
return (
<Modal isOpen={isOpen} onClose={onClose}>
<ModalOverlay />
@@ -59,7 +57,7 @@ const InitiateReversalPopup = ({
onSubmit={handleSubmit((data) => {
handelApproved(data);
reset();
onClose()
onClose();
})}
>
<ModalBody>
@@ -69,24 +67,24 @@ const InitiateReversalPopup = ({
rows={6}
focusBorderColor="green.400"
name="fileName"
{...register("comments")}
{...register("comment")}
fontSize="sm"
type="textarea"
size="md"
placeholder={"Enter your comments...."}
placeholder={"Enter your comment...."}
rounded={"md"}
resize={"none"}
mb={2}
/>
{errors.comments ? (
{errors.comment ? (
<Text fontSize="xs" color="red">
{errors.comments.message}
{errors.comment.message}
</Text>
) : (
<Text fontSize="xs" color="gray.500">
Maximum length should be 150 characters. You have entered{" "}
{watch()?.comments?.length || 0} characters.
{watch()?.comment?.length || 0} characters.
</Text>
)}
</FormControl>