Skip to content

Commit

Permalink
fix: renamed semester to exam
Browse files Browse the repository at this point in the history
  • Loading branch information
harshkhandeparkar committed Feb 16, 2024
1 parent 5c7a59a commit 600b7c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/SearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const SearchResults: Component<Props> = (props) => {
<div class="result-card">
<p>Course Name: {decodeURIComponent(result.course_name)}</p>
<p>Year: {result.year}</p>
<p>Semester: {result.exam}</p>
<p>Exam: {result.exam}</p>
<a href={result.filelink} target="_blank" rel="noopener noreferrer">
Download File
</a>
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/components/searchForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function CourseSearchForm() {
// Create signals for each form input
const [courseName, setCourseName] = createSignal("");
const [year, setYear] = createSignal<number>(0);
const [semester, setSemester] = createSignal("");
const [exam, setExam] = createSignal("");
const [years, setYears] = createSignal<number[]>([]);
const [searchResults, setSearchResults] = createSignal<SearchResult[]>([]);
const [noResultsFound, setNoResultsFound] = createSignal<boolean>(false);
Expand All @@ -30,12 +30,12 @@ function CourseSearchForm() {
const handleSubmit = async (event: any) => {
event.preventDefault(); // Prevent the default form submit action

console.log("Form submitted!", courseName(), year(), semester());
console.log("Form submitted!", courseName(), year(), exam());

const params = new URLSearchParams();
if (courseName()) params.append("course", courseName());
if (year()) params.append("year", year().toString());
if (semester()) params.append("semester", semester());
if (exam()) params.append("exam", exam());

try {
const response = await fetch(`${import.meta.env.VITE_BACKEND_URL}/search?${params}`, {
Expand Down Expand Up @@ -68,9 +68,9 @@ function CourseSearchForm() {
</select>
</div>
<div>
<label for="semester">Semester:</label>
<select id="semester" value={semester()} onInput={(e) => setSemester(e.target.value)}>
<option value="">Select a semester</option>
<label for="exam">Exam:</label>
<select id="exam" value={exam()} onInput={(e) => setExam(e.target.value)}>
<option value="">Select an exam</option>
<option value="Mid Sem">Mid Sem</option>
<option value="End Sem">End Sem</option>
</select>
Expand Down

0 comments on commit 600b7c8

Please sign in to comment.