diff --git a/src/App.tsx b/src/App.tsx index 0a97d10..d631fd2 100755 --- a/src/App.tsx +++ b/src/App.tsx @@ -354,14 +354,14 @@ const App: React.FC = () => { }; // 업체명·주소 수동 입력으로 마케팅 분석 API 호출 - const handleManualInput = async (businessName: string, address: string, category: string) => { + const handleManualInput = async (businessName: string, address: string, category: string, officialSiteUrl?: string) => { setAfterLoadTarget('generation_flow'); setViewMode('loading'); setIsAnalysisComplete(false); setError(null); try { - const data = await marketingAnalysis(businessName, address, category); + const data = await marketingAnalysis(businessName, address, category, officialSiteUrl); if (!validateCrawlingResponse(data)) { throw new Error(t('app.autocompleteError')); diff --git a/src/components/BusinessNameInputModal.tsx b/src/components/BusinessNameInputModal.tsx index 22f844a..82992a2 100644 --- a/src/components/BusinessNameInputModal.tsx +++ b/src/components/BusinessNameInputModal.tsx @@ -5,7 +5,7 @@ import CitySelectModal, { REGIONS } from './CitySelectModal'; interface BusinessNameInputModalProps { onClose: () => void; - onSubmit: (businessName: string, address: string, category: string) => void; + onSubmit: (businessName: string, address: string, category: string, officialSiteUrl: string) => void; } const BusinessNameInputModal: React.FC = ({ onClose, onSubmit }) => { @@ -14,6 +14,7 @@ const BusinessNameInputModal: React.FC = ({ onClose const [selectedCity, setSelectedCity] = useState(''); const [detailAddress, setDetailAddress] = useState(''); const [category, setCategory] = useState(''); + const [officialSiteUrl, setOfficialSiteUrl] = useState(''); const [isCityModalOpen, setIsCityModalOpen] = useState(false); useEffect(() => { @@ -42,7 +43,12 @@ const BusinessNameInputModal: React.FC = ({ onClose const handleSubmit = () => { if (!isValid) return; const fullAddress = `${selectedCity} ${detailAddress.trim()}`; - onSubmit(businessName.trim(), fullAddress, category.trim()); + // 프로토콜 없이 입력하면 https:// 를 붙여서 전달 + const trimmedUrl = officialSiteUrl.trim(); + const normalizedUrl = trimmedUrl && !/^https?:\/\//i.test(trimmedUrl) + ? `https://${trimmedUrl}` + : trimmedUrl; + onSubmit(businessName.trim(), fullAddress, category.trim(), normalizedUrl); onClose(); }; @@ -118,6 +124,19 @@ const BusinessNameInputModal: React.FC = ({ onClose /> +
+ + setOfficialSiteUrl(e.target.value)} + onKeyDown={handleKeyDown} + maxLength={2048} + /> +
+