Ensure application/json on library flows reqs

This commit is contained in:
Nick O'Leary
2014-11-05 22:41:05 +00:00
parent e7eb02fcb7
commit a520240b25
5 changed files with 47 additions and 31 deletions

View File

@@ -236,7 +236,12 @@ RED.editor = (function() {
//TODO: move this to RED.library
var flowName = $("#node-input-filename").val();
if (!/^\s*$/.test(flowName)) {
$.post('library/flows/'+flowName,$("#node-input-filename").attr('nodes'),function() {
$.ajax({
url:'library/flows/'+flowName,
type: "POST",
data: $("#node-input-filename").attr('nodes'),
contentType: "application/json; charset=utf-8"
}).done(function() {
RED.library.loadFlowLibrary();
RED.notify("Saved nodes","success");
});