From e880924eadd4b1c3d048da0012b79ebe0616b693 Mon Sep 17 00:00:00 2001 From: Will Sheldon <114631109+wssheldon@users.noreply.github.com> Date: Mon, 6 Mar 2023 15:35:34 -0800 Subject: [PATCH] Correctly pass response data back after saving entity type to display as chip in combobox (#3061) --- src/dispatch/static/dispatch/src/entity_type/store.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dispatch/static/dispatch/src/entity_type/store.js b/src/dispatch/static/dispatch/src/entity_type/store.js index fadd59ee75de..7eae9a81c3f7 100644 --- a/src/dispatch/static/dispatch/src/entity_type/store.js +++ b/src/dispatch/static/dispatch/src/entity_type/store.js @@ -17,6 +17,7 @@ const getDefaultSelectedState = () => { working_signal: null, project: null, default: false, + loading: false, } } @@ -73,15 +74,16 @@ const actions = { commit("SET_SELECTED_LOADING", true) if (!state.selected.id) { return EntityTypeApi.create(state.selected) - .then(() => { - commit("SET_SELECTED_LOADING", false) - dispatch("closeCreateEdit") - dispatch("getAll") + .then((resp) => { commit( "notification_backend/addBeNotification", { text: "Entity type created successfully.", type: "success" }, { root: true } ) + commit("SET_SELECTED_LOADING", false) + commit("RESET_SELECTED") + commit("SET_DIALOG_CREATE_EDIT", false) + return resp.data }) .catch(() => { commit("SET_SELECTED_LOADING", false)