From 36e98e858a5d46939fafdaa9d13db41f662ca585 Mon Sep 17 00:00:00 2001 From: avasthiayush <46842991+avasthiayush@users.noreply.github.com> Date: Thu, 1 Oct 2020 13:43:43 +0530 Subject: [PATCH] adding function of updating hospital_beds using javascript. --- Public/js/homepage.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Public/js/homepage.js b/Public/js/homepage.js index 2140376..f490449 100644 --- a/Public/js/homepage.js +++ b/Public/js/homepage.js @@ -37,21 +37,16 @@ document.getElementById("clicksearch").addEventListener("click",function() }); +const update = document.querySelector('#update1_hospitalbed') -// updating data + update.addEventListener('click', => { + fetch('/dashboard/update/hospital_beds', { + method: 'put', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(), + }) - -// const update = document.querySelector('#update1') - -// update.addEventListener('click', _ => { -// // Send PUT Request here -// fetch('/dashboard/update/beds', { -// method: 'put', -// headers: { 'Content-Type': 'application/json' }, -// body: JSON.stringify(), -// }) - -// }) +})