diff --git a/class_registration_app/src/assets/main.css b/class_registration_app/src/assets/main.css index bbb7c6c..90a23cd 100644 --- a/class_registration_app/src/assets/main.css +++ b/class_registration_app/src/assets/main.css @@ -97,3 +97,10 @@ a, transform: translateY(-5px); } +.course-list-item { + margin-bottom: 40px; + min-width: 80vw; + background-color: #ffffff; + border-radius: 10px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} diff --git a/class_registration_app/src/components/CourseSearch.vue b/class_registration_app/src/components/CourseSearch.vue index a2018d0..8a320c0 100644 --- a/class_registration_app/src/components/CourseSearch.vue +++ b/class_registration_app/src/components/CourseSearch.vue @@ -1,50 +1,72 @@ +const response = fetch(`${apiUrl}/courses`); +let courseJson = fetch(`${apiUrl}/courses`) + .then(response => { + if (response.ok) { + return response.json() + } else{ + throw "Error" + } + }).then(response => { + console.log(response.Items); + response.Items.forEach((Course: { CourseId: string; }) => { + let container = document.getElementById("container"); + let div = document.createElement("div"); + let class_name = document.createElement('h2') + // Set class or any other attributes for the div + div.className = "course-list-item"; // You can set class name here + + // Set content or any other properties for the div + class_name.textContent = Course.CourseId; // You can set content here + // Append the div to the container + if (container != null){ + container.appendChild(div); + div.appendChild(class_name); + } + return response; + }) + }) + -// Your API Gateway endpoint URL \ No newline at end of file