diff options
Diffstat (limited to 'app/assets/javascripts/work_items/components/work_item_state_toggle.vue')
-rw-r--r-- | app/assets/javascripts/work_items/components/work_item_state_toggle.vue | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/app/assets/javascripts/work_items/components/work_item_state_toggle.vue b/app/assets/javascripts/work_items/components/work_item_state_toggle.vue index 581ef9ec945..69752967efe 100644 --- a/app/assets/javascripts/work_items/components/work_item_state_toggle.vue +++ b/app/assets/javascripts/work_items/components/work_item_state_toggle.vue @@ -3,7 +3,6 @@ import { GlButton, GlDisclosureDropdownItem, GlLoadingIcon } from '@gitlab/ui'; import * as Sentry from '~/sentry/sentry_browser_wrapper'; import Tracking from '~/tracking'; import { __ } from '~/locale'; -import { getUpdateWorkItemMutation } from '~/work_items/components/update_work_item'; import { sprintfWorkItem, I18N_WORK_ITEM_ERROR_UPDATING, @@ -12,6 +11,7 @@ import { STATE_EVENT_REOPEN, TRACKING_CATEGORY_SHOW, } from '../constants'; +import updateWorkItemMutation from '../graphql/update_work_item.mutation.graphql'; export default { components: { @@ -33,11 +33,6 @@ export default { type: String, required: true, }, - workItemParentId: { - type: String, - required: false, - default: null, - }, showAsDropdownItem: { type: Boolean, required: false, @@ -75,24 +70,19 @@ export default { }, methods: { async updateWorkItem() { - const input = { - id: this.workItemId, - stateEvent: this.isWorkItemOpen ? STATE_EVENT_CLOSE : STATE_EVENT_REOPEN, - }; - this.updateInProgress = true; try { this.track('updated_state'); - const { mutation, variables } = getUpdateWorkItemMutation({ - workItemParentId: this.workItemParentId, - input, - }); - const { data } = await this.$apollo.mutate({ - mutation, - variables, + mutation: updateWorkItemMutation, + variables: { + input: { + id: this.workItemId, + stateEvent: this.isWorkItemOpen ? STATE_EVENT_CLOSE : STATE_EVENT_REOPEN, + }, + }, }); const errors = data.workItemUpdate?.errors; @@ -102,7 +92,6 @@ export default { } } catch (error) { const msg = sprintfWorkItem(I18N_WORK_ITEM_ERROR_UPDATING, this.workItemType); - this.$emit('error', msg); Sentry.captureException(error); } |