Skip to content

Commit 6e1b4ed

Browse files
committed
refactor(course-search): remove redundant validation message for division toggles
1 parent d93e467 commit 6e1b4ed

1 file changed

Lines changed: 1 addition & 27 deletions

File tree

features/course-search/course-search-panel.tsx

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function CourseSearchContent({
8686
lowerDivision: true,
8787
upperDivision: true,
8888
});
89-
const [validationError, setValidationError] = useState("");
89+
9090
const [isSubmitting, setIsSubmitting] = useState(false);
9191

9292
const isSearching = isLoading || isSubmitting;
@@ -107,13 +107,6 @@ function CourseSearchContent({
107107

108108
const handleSearch = async (event: React.FormEvent) => {
109109
event.preventDefault();
110-
if (!formData.lowerDivision && !formData.upperDivision) {
111-
setValidationError(
112-
"Please select at least one course division (Lower or Upper)",
113-
);
114-
return;
115-
}
116-
setValidationError("");
117110
if (!onSearchSubmit) return;
118111

119112
try {
@@ -187,25 +180,6 @@ function CourseSearchContent({
187180
/>
188181
</div>
189182

190-
{validationError && (
191-
<div className="flex items-center gap-3 px-4 py-3 bg-red-50 border border-red-200 rounded-xl mb-4">
192-
<svg
193-
className="w-5 h-5 text-red-600 flex-shrink-0"
194-
fill="none"
195-
stroke="currentColor"
196-
viewBox="0 0 24 24"
197-
>
198-
<path
199-
strokeLinecap="round"
200-
strokeLinejoin="round"
201-
strokeWidth={2}
202-
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
203-
/>
204-
</svg>
205-
<p className="text-sm text-red-700">{validationError}</p>
206-
</div>
207-
)}
208-
209183
<Button
210184
type="submit"
211185
color="orange"

0 commit comments

Comments
 (0)