Browse Source

Read API data in editor from top-level object

There is no more meta object
pull/4/head
Matt Baer 6 years ago
parent
commit
597395f312
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      templates/editor.html

+ 2
- 2
templates/editor.html View File

@@ -125,7 +125,7 @@
data: {html: editor.getSession().getValue(), public: $publicCheck.checked ? "true" : ""},
success: function(data, status, xhr) {
publishing = false;
{{if .ID}}if (data.meta.code == 200) { {{else}}if (data.meta.code == 201) {
{{if .ID}}if (data.code == 200) { {{else}}if (data.code == 201) {
var houses = JSON.parse(H.get('neighborhood', '[]'));
houses.push({id: data.data.id, token: xhr.getResponseHeader('Authorization')});
H.set('neighborhood', JSON.stringify(houses));{{end}}
@@ -133,7 +133,7 @@
{{if .ID}}{{else}}H.remove('constructionSite');{{end}}
window.location = '/' + data.data.id + '.html';
} else {
alert(data.meta.error_msg);
alert(data.error_msg);
}
},
error: function(jqXHR, status, error) {


Loading…
Cancel
Save