From d5c9172f8af5946537d3b62adcce3ff0ca812998 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 1 Jan 2024 19:35:51 +1300 Subject: [PATCH] . --- client/dist/js/bundle.js | 12 ++++++------ client/src/components/ElementEditor/ElementEditor.js | 10 +--------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index 928c6fbb..2fe8f5c9 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -2177,6 +2177,8 @@ var ElementEditor = function (_PureComponent) { }, { key: 'handleDragEnd', value: function handleDragEnd(sourceId, afterId) { + var _this2 = this; + var globalUseGraphQL = false; if (globalUseGraphQL) { var _props = this.props, @@ -2191,10 +2193,8 @@ var ElementEditor = function (_PureComponent) { _Backend2.default.post('/admin/elemental-area/sort', { ID: sourceId, afterBlockID: afterId - }).then(function (response) { - return response.json(); - }).then(function (responseJson) { - console.log(responseJson); + }).then(function () { + return _this2.fetchBlocks(); }); } @@ -2206,7 +2206,7 @@ var ElementEditor = function (_PureComponent) { }, { key: 'fetchBlocks', value: function fetchBlocks() { - var _this2 = this; + var _this3 = this; var doSetLoadingState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; @@ -2218,7 +2218,7 @@ var ElementEditor = function (_PureComponent) { _Backend2.default.get('/admin/elemental-area/readBlocks/' + this.props.areaId).then(function (response) { return response.json(); }).then(function (responseJson) { - _this2.setState(_extends({}, _this2.state, { + _this3.setState(_extends({}, _this3.state, { contentBlocks: responseJson, isLoading: false })); diff --git a/client/src/components/ElementEditor/ElementEditor.js b/client/src/components/ElementEditor/ElementEditor.js index 817f4235..7eabe07b 100644 --- a/client/src/components/ElementEditor/ElementEditor.js +++ b/client/src/components/ElementEditor/ElementEditor.js @@ -80,15 +80,7 @@ class ElementEditor extends PureComponent { ID: sourceId, afterBlockID: afterId, }) - .then(response => response.json()) - .then(responseJson => { - console.log(responseJson); - // this.setState({ - // ...this.state, - // contentBlocks: responseJson, - // isLoading: false, - // }) - }); + .then(() => this.fetchBlocks()) } this.setState({