Skip to content

Commit

Permalink
Correctly pass response data back after saving entity type to display…
Browse files Browse the repository at this point in the history
… as chip in combobox (Netflix#3061)
  • Loading branch information
wssheldon authored and rutvijmehta-harness committed Mar 17, 2023
1 parent 8b7f2d6 commit 426f181
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/dispatch/static/dispatch/src/entity_type/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const getDefaultSelectedState = () => {
working_signal: null,
project: null,
default: false,
loading: false,
}
}

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 426f181

Please sign in to comment.