SHARE
TWEET

Untitled

a guest Jan 22nd, 2020 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const addParking = () => {
  2.     // Getting the coords
  3.     const coords = document.getElementById("newParkingCoord").getAttribute("value").replace("(", "").replace(")", "").split(",");
  4.     const address = document.getElementById("newParkingAddress").value;
  5.  
  6.     fetch("/Parkings", {
  7.     method: 'POST',
  8.     body: JSON.stringify({ 'id': null,
  9.                            'x_coord': coords[0],
  10.                            'y_coord': coords[1],
  11.                            'address': address,
  12.                            'time':  new Date().toLocaleString("he-IL")
  13.     }),
  14.     headers: {'content-type': 'application/json'}
  15.     })
  16.     .then((response)=>{
  17.     refreshParkings();
  18.     });
  19.  
  20.  
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top