mirror of
https://github.com/BreizhHardware/ProjetS4COMWEB.git
synced 2026-01-18 16:47:35 +01:00
Add try catch to Yanis function
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user