Browse Source
fix JSON request to always send arrays
pull/82/head
Aaron Parecki
8 years ago
No known key found for this signature in database
GPG Key ID: 276C2817346D6056
1 changed files with
6 additions and
0 deletions
-
views/new-post.php
|
@ -700,6 +700,12 @@ $(function(){ |
|
|
} |
|
|
} |
|
|
request.send(formData); |
|
|
request.send(formData); |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
// Convert all single-value properties to arrays
|
|
|
|
|
|
for(var k in entry) { |
|
|
|
|
|
if(typeof entry[k] == "string") { |
|
|
|
|
|
entry[k] = [entry[k]]; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
$.post("/micropub/postjson", { |
|
|
$.post("/micropub/postjson", { |
|
|
data: JSON.stringify({ |
|
|
data: JSON.stringify({ |
|
|
"type": ["h-entry"], |
|
|
"type": ["h-entry"], |
|
|