X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/d095dfe3d4c1ec90cebdfb3307564022cbeaf878..154af087869566bbe3c5871d642a40ebd596cb1f:/app/assets/javascripts/index/new_note.js diff --git a/app/assets/javascripts/index/new_note.js b/app/assets/javascripts/index/new_note.js index 73fcda97c..b1457d10b 100644 --- a/app/assets/javascripts/index/new_note.js +++ b/app/assets/javascripts/index/new_note.js @@ -34,17 +34,17 @@ OSM.NewNote = function (map) { }); function createNote(location, text, callback) { - $.ajax({ - url: "/api/0.6/notes.json", - type: "POST", - oauth: true, - data: { + fetch("/api/0.6/notes.json", { + method: "POST", + headers: { ...OSM.oauth }, + body: new URLSearchParams({ lat: location.lat, lon: location.lng, text - }, - success: callback - }); + }) + }) + .then(response => response.json()) + .then(callback); } function addCreatedNoteMarker(feature) {