Welcome to mirror list, hosted at ThFree Co, Russian Federation.

update_work_item.js « components « work_items « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fc395fa5be3ee9277197eb9583df4f76d7ee1711 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import updateWorkItemMutation from '../graphql/update_work_item.mutation.graphql';
import updateWorkItemTaskMutation from '../graphql/update_work_item_task.mutation.graphql';

export function getUpdateWorkItemMutation({ input, workItemParentId }) {
  let mutation = updateWorkItemMutation;

  const variables = {
    input,
  };

  if (workItemParentId) {
    mutation = updateWorkItemTaskMutation;
    variables.input = {
      id: workItemParentId,
      taskData: input,
    };
  }

  return {
    mutation,
    variables,
  };
}