mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-16 05:49:16 +02:00
Fix ImproveOSM request payload
- Seems that the expected payload has changed so now all error types use key "targetIds" - Also includes minor fix so that comments display in the UI immediately
This commit is contained in:
@@ -361,9 +361,10 @@ export default {
|
||||
var that = this;
|
||||
d3_json(url)
|
||||
.then(function(data) {
|
||||
// Assign directly for immediate use in the callback
|
||||
// comments are served newest to oldest
|
||||
var comments = data.comments ? data.comments.reverse() : [];
|
||||
that.replaceError(d.update({ comments: comments }));
|
||||
d.comments = data.comments ? data.comments.reverse() : [];
|
||||
that.replaceError(d);
|
||||
if (callback) callback(null, d);
|
||||
})
|
||||
.catch(function(err) {
|
||||
@@ -390,18 +391,10 @@ export default {
|
||||
var key = d.error_key;
|
||||
var url = _impOsmUrls[key] + '/comment';
|
||||
var payload = {
|
||||
username: user.display_name
|
||||
username: user.display_name,
|
||||
targetIds: [ d.identifier ]
|
||||
};
|
||||
|
||||
// Each error type has different data for identification
|
||||
if (key === 'ow') {
|
||||
payload.roadSegments = [ d.identifier ];
|
||||
} else if (key === 'mr') {
|
||||
payload.tiles = [ d.identifier ];
|
||||
} else if (key === 'tr') {
|
||||
payload.targetIds = [ d.identifier ];
|
||||
}
|
||||
|
||||
if (d.newStatus !== undefined) {
|
||||
payload.status = d.newStatus;
|
||||
payload.text = 'status changed';
|
||||
|
||||
Reference in New Issue
Block a user