From b51fdbb7e709b832b20367e2be73f95321e7388e Mon Sep 17 00:00:00 2001 From: Ted Ian Osias Date: Sat, 4 Oct 2025 20:44:45 +0800 Subject: [PATCH] Fix #141: Make URL field required in proposal creation form - Add required validation to proposalUrl in yup schema - Add required attribute to URL input field - Remove 'emptyField' fallback for empty URLs - Display 'URL is required' error message when field is empty --- src/components/proposal/DescriptionProposal.jsx | 3 ++- src/components/proposal/ProposalForm.jsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/proposal/DescriptionProposal.jsx b/src/components/proposal/DescriptionProposal.jsx index e7686812..38d4e54d 100644 --- a/src/components/proposal/DescriptionProposal.jsx +++ b/src/components/proposal/DescriptionProposal.jsx @@ -14,7 +14,7 @@ import {Editor} from "react-draft-wysiwyg"; import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; const schema = yup.object().shape({ - proposalUrl: yup.string().url("Must be a valid url"), + proposalUrl: yup.string().url("Must be a valid url").required("URL is required"), }); @@ -185,6 +185,7 @@ function DescriptionProposal({onNext, onBack}) { name="proposalUrl" id="proposalUrl" ref={register} + required />