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

merge_request.js « endpoints « consumer « contracts « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 74fd4e75bec38e534079472617d527d92fd0370c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
'use strict';

const axios = require('axios');

exports.getMetadata = (endpoint) => {
  const url = endpoint.url;

  return axios
    .request({
      method: 'GET',
      baseURL: url,
      url: '/diffs_metadata.json',
      headers: { Accept: '*/*' },
    })
    .then((response) => response.data);
};

exports.getDiscussions = (endpoint) => {
  const url = endpoint.url;

  return axios
    .request({
      method: 'GET',
      baseURL: url,
      url: '/discussions.json',
      headers: { Accept: '*/*' },
    })
    .then((response) => response.data);
};

exports.getDiffs = (endpoint) => {
  const url = endpoint.url;

  return axios
    .request({
      method: 'GET',
      baseURL: url,
      url: '/diffs_batch.json?page=0',
      headers: { Accept: '*/*' },
    })
    .then((response) => response.data);
};