X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/3d3b2b47964ec91ef1ab1946b7258a06665caced..00108bc9b7e9e03a47d89343e7f53eb924977ff8:/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) {