Fixed bug with unresponsive button
All checks were successful
Compile Java Backend / Compile Backend Code (push) Successful in 1m32s
Lint Java Backend / Checkstyle Java Linting (push) Successful in 54s
Lint Dockerfiles / Lint Dockerfiles (push) Successful in 11s
Lint Frontend / Lint HTML, CSS, and JS (push) Successful in 39s

This commit is contained in:
2025-11-10 20:59:17 +01:00
parent e2cdac569a
commit 0ffeb914c3
3 changed files with 27 additions and 4 deletions

View File

@@ -2,9 +2,15 @@ import { openModal } from "./components/modals.js";
import { getDoctors, filterDoctors, saveDoctor } from "./services/doctorServices.js";
import { createDoctorCard } from "./components/doctorCard.js";
window.onload = function () {
document.addEventListener("DOMContentLoaded", () => {
const loginBtn = document.getElementById("addDocBtn");
if (loginBtn) {
loginBtn.addEventListener("click", () => {
openModal("addDoctor");
});
}
loadDoctorCards();
};
});
async function loadDoctorCards() {
try {
@@ -15,6 +21,16 @@ async function loadDoctorCards() {
}
}
function renderDoctorCards(doctors) {
const contentDiv = document.getElementById("content");
contentDiv.innerHTML = "";
doctors.forEach(doctor => {
const card = createDoctorCard(doctor);
contentDiv.appendChild(card);
});
}
window.adminAddDoctor = async function() {
const doctor = {
"name": document.getElementById("doctorName").value,

View File

@@ -63,6 +63,13 @@ function attachHeaderButtonListeners() {
if (signup) {
signup.addEventListener('click', () => { openModal('patientSignup'); });
}
const addDoctor = document.getElementById("addDocBtn");
if (addDoctor) {
addDoctor.addEventListener('click', () => { openModal('addDoctor'); });
}
}
function logout() {

View File

@@ -5,11 +5,11 @@
<title>Admin Dashboard</title>
<link rel="stylesheet" th:href="@{/assets/css/adminDashboard.css}">
<link rel="stylesheet" th:href="@{/assets/css/style.css}">
<link rel="icon" type="image/png" th:href="@{/assets/images/logo/logo.png}" />
<script th:src="@{/js/render.js}" defer></script>
<script th:src="@{/js/util.js}" defer></script>
<script th:src="@{/js/components/header.js}" defer></script>
<script th:src="@{/js/components/footer.js}" defer></script>
<link rel="icon" type="image/png" th:href="@{/assets/images/logo/logo.png}" />
</head>
<body onload="renderContent()">