From ec2e7473e7a294a62cb3c075e71cb6b073f82749 Mon Sep 17 00:00:00 2001 From: Kishore <42832651+kishore03109@users.noreply.github.com> Date: Mon, 2 Oct 2023 09:52:43 +0800 Subject: [PATCH] fix(announcements): add validation url --- src/layouts/EditHomepage/EditHomepage.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/layouts/EditHomepage/EditHomepage.jsx b/src/layouts/EditHomepage/EditHomepage.jsx index 5c189b216..382f4ce5f 100644 --- a/src/layouts/EditHomepage/EditHomepage.jsx +++ b/src/layouts/EditHomepage/EditHomepage.jsx @@ -578,6 +578,7 @@ const EditHomepage = ({ match }) => { .announcements.announcement_items[announcementItemsIndex].link_url const isLinkUrlError = isLinkTextFilled && !isLinkUrlFilled + const isLinkTextError = !isLinkTextFilled && isLinkUrlFilled const isLinkUrlOrTextChanged = field === "link_text" || field === "link_url" if (isLinkUrlOrTextChanged) { @@ -586,6 +587,11 @@ const EditHomepage = ({ match }) => { ].link_url = isLinkUrlError ? "Please specify a URL for your link" : "" + newErrors.announcementItems[ + announcementItemsIndex + ].link_text = isLinkTextError + ? "Please specify text for your link" + : "" } setFrontMatter({