Ignore:
Timestamp:
10/12/24 21:32:15 (5 weeks ago)
Author:
macagaso <gasoskamarija@…>
Branches:
master
Parents:
743de55
Message:

Updated version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/resources/static/js/shared.js

    r743de55 r43c9090  
    2121            if (!response.ok) {
    2222                throw new Error('Failed to delete the appointment');
     23            }
     24            else{
     25                location.reload();
    2326            }
    2427        })
     
    4750
    4851            if (updateResponse.ok) {
     52                location.reload();
    4953                console.log(`User updated successfully in carried_out`);
    5054            } else {
     
    136140
    137141            }
     142            location.reload();
    138143
    139144        } else {
     
    149154        if (response.ok) {
    150155            console.log('Appointment added successfully.');
     156            location.reload();
    151157        } else {
    152158            const text = await response.text();
     
    160166export function displayDiv(dateTime,username){
    161167    if (typeof username !== 'undefined'){
    162         makeReservation(dateTime,username);
     168        makeReservation(dateTime, username);
    163169    }
    164170    else{
    165         const inputValue = document.getElementById("username-approval");
    166         const approvedUser = inputValue.value;
    167         document.getElementById("confirm-approval").addEventListener('click',makeReservation(dateTime,approvedUser));
     171        let temp=document.getElementById("confirm-approval");
     172        temp.addEventListener('click',()=>{
     173            const approvedUser = document.getElementById("username-approval").value;
     174            makeReservation(dateTime,approvedUser)
     175        });
    168176    }
    169177}
Note: See TracChangeset for help on using the changeset viewer.