diff options
Diffstat (limited to 'app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue')
-rw-r--r-- | app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue b/app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue index 51c83784d06..289a48b5eaf 100644 --- a/app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue +++ b/app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue @@ -13,7 +13,8 @@ import { debounce } from 'lodash'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '~/lib/utils/constants'; import { __, s__, sprintf } from '~/locale'; -import projectWorkItemTypesQuery from '~/work_items/graphql/project_work_item_types.query.graphql'; +import { addHierarchyChild } from '../../graphql/cache_utils'; +import projectWorkItemTypesQuery from '../../graphql/project_work_item_types.query.graphql'; import projectWorkItemsQuery from '../../graphql/project_work_items.query.graphql'; import updateWorkItemMutation from '../../graphql/update_work_item.mutation.graphql'; import createWorkItemMutation from '../../graphql/create_work_item.mutation.graphql'; @@ -48,6 +49,11 @@ export default { required: false, default: null, }, + workItemIid: { + type: String, + required: false, + default: null, + }, childrenIds: { type: Array, required: false, @@ -292,13 +298,14 @@ export default { variables: { input: this.workItemInput, }, + update: (cache, { data }) => + addHierarchyChild(cache, this.fullPath, this.workItemIid, data.workItemCreate.workItem), }) .then(({ data }) => { if (data.workItemCreate?.errors?.length) { [this.error] = data.workItemCreate.errors; } else { this.unsetError(); - this.$emit('addWorkItemChild', data.workItemCreate.workItem); } }) .catch(() => { |