Skip to content

Commit

Permalink
fixed search
Browse files Browse the repository at this point in the history
  • Loading branch information
zjf19002 committed Nov 1, 2023
1 parent 37ae438 commit 1f96007
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions class_registration_app/src/components/CourseSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function handleSearch() {
//arn:aws:execute-api:us-east-1:671289147354:5prodolbi7/*/GET/courses
const apiUrl = 'https://5prodolbi7.execute-api.us-east-1.amazonaws.com/Beta';
const response = fetch(`${apiUrl}/courses`);
let courseJson = fetch(`${apiUrl}/courses`)
.then(response => {
if (response.ok) {
Expand All @@ -27,7 +27,7 @@ function handleSearch() {
console.log(response.Items);
let searchbar = document.getElementById("search");
let filteredCourses = response.Items.filter(function (str: string) { return str.CourseId.includes(searchbar.value.toUpperCase())} );
filteredCourses.forEach((Course: { CourseId: string; CourseLocation: string;}) => {
let container = document.getElementById("container");
Expand Down Expand Up @@ -55,8 +55,9 @@ function handleSearch() {
})
})
}
document.addEventListener("DOMContentLoaded", function() {
document.addEventListener("click", function() {
// Get the button element by its ID
const button = document.getElementById("searchButton");
Expand Down

0 comments on commit 1f96007

Please sign in to comment.