mirror of https://gitee.com/bigwinds/arangodb
json document save validation
This commit is contained in:
parent
389308417b
commit
3d16ccda68
|
@ -771,7 +771,6 @@ var logTable = $('#logTableID').dataTable({
|
||||||
boxContent = stateReplace(boxContent);
|
boxContent = stateReplace(boxContent);
|
||||||
parsedContent = JSON.parse(boxContent);
|
parsedContent = JSON.parse(boxContent);
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "PUT",
|
type: "PUT",
|
||||||
url: "/document/" + collectionID,
|
url: "/document/" + collectionID,
|
||||||
|
@ -794,25 +793,6 @@ var logTable = $('#logTableID').dataTable({
|
||||||
console.log(e);
|
console.log(e);
|
||||||
alert("Please make sure the entered value is a valid json string.");
|
alert("Please make sure the entered value is a valid json string.");
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
$.ajax({
|
|
||||||
type: "PUT",
|
|
||||||
url: "/_api/document/" + collectionID,
|
|
||||||
data: JSON.stringify(parsedContent),
|
|
||||||
contentType: "application/json",
|
|
||||||
processData: false,
|
|
||||||
success: function(data) {
|
|
||||||
tableView = true;
|
|
||||||
var collID = collectionID.split("/");
|
|
||||||
window.location.href = "#showCollection?" + collID[0];
|
|
||||||
var img = $('#toggleEditedDocButton').find('img');
|
|
||||||
img.attr('src', '/_admin/html/media/icons/off_icon16.png');
|
|
||||||
},
|
|
||||||
error: function(data) {
|
|
||||||
alert(JSON.stringify(data));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
>>>>>>> f1564a6ac6a43fdab5760955da0b20fa3af1a3ee
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -881,7 +861,6 @@ var logTable = $('#logTableID').dataTable({
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
try {
|
try {
|
||||||
var collectionID = location.hash.substr(12, location.hash.length);
|
var collectionID = location.hash.substr(12, location.hash.length);
|
||||||
var collID = collectionID.split("=");
|
var collID = collectionID.split("=");
|
||||||
|
@ -912,22 +891,6 @@ var logTable = $('#logTableID').dataTable({
|
||||||
console.log(e);
|
console.log(e);
|
||||||
alert("Please make sure the entered value is a valid json string.");
|
alert("Please make sure the entered value is a valid json string.");
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
$.ajax({
|
|
||||||
type: "POST",
|
|
||||||
url: "/_api/document?collection=" + collID,
|
|
||||||
data: JSON.stringify(jsonContent),
|
|
||||||
contentType: "application/json",
|
|
||||||
processData: false,
|
|
||||||
success: function(data) {
|
|
||||||
tableView = true;
|
|
||||||
window.location.href = "#showCollection?" + collID;
|
|
||||||
},
|
|
||||||
error: function(data) {
|
|
||||||
alert(JSON.stringify(data));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
>>>>>>> f1564a6ac6a43fdab5760955da0b20fa3af1a3ee
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue