Created services and repositories

This commit is contained in:
2025-11-07 18:11:58 +01:00
parent 42efca48ee
commit 93858408e8
25 changed files with 954 additions and 565 deletions

View File

@@ -1,4 +1,4 @@
export function renderHeader() {
function renderHeader() {
const headerDiv = document.getElementById("header");
if (window.location.pathname.endsWith("/")) {
@@ -53,26 +53,26 @@ export function renderHeader() {
attachHeaderButtonListeners();
}
export function attachHeaderButtonListeners() {
const login = document.getElementById(patientLogin);
function attachHeaderButtonListeners() {
const login = document.getElementById("patientLogin");
if (login) {
login.addEventListener('click', () => { openModal('patientLogin'); });
}
const signup = document.getElementById(patientSignup);
const signup = document.getElementById("patientSignup");
if (signup) {
signup.addEventListener('click', () => { openModal('patientSignup'); });
}
}
export function logout() {
function logout() {
localStorage.removeItem("userRole");
localStorage.removeItem("TOKEN");
window.location.href = "/";
}
export function logoutPatient() {
function logoutPatient() {
localStorage.removeItem("userRole");
selectRole('patient')
window.location.href='/pages/loggedPatientDashboard.html
selectRole('patient');
window.location.href='/pages/loggedPatientDashboard.html';
}