summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/api/integrations_api.js
blob: 692aae21a4f9dbf867d3b07219aac3674c2f7d56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import axios from '../lib/utils/axios_utils';
import { buildApiUrl } from './api_utils';

const JIRA_CONNECT_SUBSCRIPTIONS_PATH = '/api/:version/integrations/jira_connect/subscriptions';

export function addJiraConnectSubscription(namespacePath, { jwt, accessToken }) {
  const url = buildApiUrl(JIRA_CONNECT_SUBSCRIPTIONS_PATH);

  return axios.post(
    url,
    {
      jwt,
      namespace_path: namespacePath,
    },
    {
      headers: {
        Authorization: `Bearer ${accessToken}`, // eslint-disable-line @gitlab/require-i18n-strings
      },
    },
  );
}