From 414e7e6a840536ebc8b7058085d425db599dafe1 Mon Sep 17 00:00:00 2001 From: Keegan George Date: Wed, 13 Jul 2022 16:00:42 -0700 Subject: [PATCH] DEV: Remove `ajax` request as raw post is not needed --- .../api-initializers/table-editor.js | 26 +++++-------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/javascripts/discourse/api-initializers/table-editor.js b/javascripts/discourse/api-initializers/table-editor.js index 066d723..4a13a61 100644 --- a/javascripts/discourse/api-initializers/table-editor.js +++ b/javascripts/discourse/api-initializers/table-editor.js @@ -32,27 +32,13 @@ export default apiInitializer("0.11.1", (api) => { function generateModal(event) { const table = event.target.parentNode.lastElementChild; const tempTable = table.cloneNode(true); - const postId = this.id; - return ajax(`/posts/${postId}`, { - type: "GET", - cache: false, - }) - .then((result) => { - const attrs = { - widget: this, - raw: result.raw, - }; - - showModal("table-editor-modal", { - model: attrs, - }).setProperties({ - tableHtml: tempTable, - submitOnEnter: false, - }); - return result.raw; - }) - .catch(popupAjaxError); + showModal("table-editor-modal", { + model: this, + }).setProperties({ + tableHtml: tempTable, + submitOnEnter: false, + }); } function generatePopups(tables, attrs) {