From 597395f312f475ccffba2c4f38792c45016dc7a4 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Mon, 12 Mar 2018 11:03:55 -0400 Subject: [PATCH] Read API data in editor from top-level object There is no more meta object --- templates/editor.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/editor.html b/templates/editor.html index 4743b5e..4a71e58 100644 --- a/templates/editor.html +++ b/templates/editor.html @@ -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) {