From efbb72ca4c8fe270530e8338818156ca6e3bfbb8 Mon Sep 17 00:00:00 2001
From: Swapnil Bendal <84583651+Swapnil155@users.noreply.github.com>
Date: Fri, 17 Jan 2025 19:16:10 +0530
Subject: [PATCH] Refactor validation schema by renaming 'comments' to
'comment' in ConfirmReversalPopups and RejectReversalPopups components
---
src/Components/Popups/ConfirmReversalPopups.jsx | 14 +++++++-------
src/Components/Popups/RejectReversalPopups.jsx | 14 +++++++-------
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/Components/Popups/ConfirmReversalPopups.jsx b/src/Components/Popups/ConfirmReversalPopups.jsx
index 8918201..eb42ad4 100644
--- a/src/Components/Popups/ConfirmReversalPopups.jsx
+++ b/src/Components/Popups/ConfirmReversalPopups.jsx
@@ -25,7 +25,7 @@ import { useForm } from "react-hook-form";
import ReactQuill from "react-quill";
export const conformModalSchema = yup.object().shape({
- comments: yup
+ comment: yup
.string()
.min(2, "Minimum length should be 150 characters.")
.max(150, "Maximum length should be 150 characters.")
@@ -93,24 +93,24 @@ const ConfirmReversalPopups = ({
- {errors.comments ? (
+ {errors.comment ? (
- {errors.comments.message}
+ {errors.comment.message}
) : (
Maximum length should be 150 characters. You have entered{" "}
- {watch()?.comments?.length || 0} characters.
+ {watch()?.comment?.length || 0} characters.
)}
diff --git a/src/Components/Popups/RejectReversalPopups.jsx b/src/Components/Popups/RejectReversalPopups.jsx
index 4bff86e..9df7924 100644
--- a/src/Components/Popups/RejectReversalPopups.jsx
+++ b/src/Components/Popups/RejectReversalPopups.jsx
@@ -21,7 +21,7 @@ import { yupResolver } from "@hookform/resolvers/yup";
import { useForm } from "react-hook-form";
export const conformModalSchema = yup.object().shape({
- comments: yup
+ comment: yup
.string()
.min(2, "Minimum length should be 150 characters.")
.max(150, "Maximum length should be 150 characters.")
@@ -66,24 +66,24 @@ const RejectReversalPopups = ({
- {errors.comments ? (
+ {errors.comment ? (
- {errors.comments.message}
+ {errors.comment.message}
) : (
Maximum length should be 150 characters. You have entered{" "}
- {watch()?.comments?.length || 0} characters.
+ {watch()?.comment?.length || 0} characters.
)}