Add try catch to Yanis function

This commit is contained in:
2024-04-08 09:25:30 +02:00
parent bd10708460
commit cdef221672
2 changed files with 11 additions and 6 deletions

View File

@@ -30,7 +30,7 @@ $router->GET('/api/search-postal', ["postal"], function($postal){
$router->GET('/api/search', ["type", "postal"], function($type, $postal){
global $pdo;
searchDoctorByLocation($pdo, $postal, $type);
})
});
$router->GET('/api/rdv', ["id"], function($id){
global $pdo;

View File

@@ -189,7 +189,6 @@ function displayCalendar(data) {
function displayAlert(text) {
let alert = document.getElementById("Alert");
console.log(text);
alert.innerHTML = "";
alert.innerHTML = `
<div class="alert alert-success" role="alert">
@@ -366,11 +365,17 @@ function DisplayRDVPraticient(rdv){
}
function ButtonShowRdvPraticient() {
document.getElementById("CalendarPraticient").addEventListener("click", function () {
ajaxRequest('GET', "src/API/requests.php/api/rdv-praticient?id=" + id, function (data) {
DisplayRDVPraticient(data);
try {
document.getElementById("CalendarPraticient").addEventListener("click", function () {
ajaxRequest('GET', "src/API/requests.php/api/rdv-praticient?id=" + 1, function (data) {
DisplayRDVPraticient(data);
});
});
});
}
catch (e) {
//Do nothing
//console.error(e);
}
}
//End Call