debian-mirror-gitlab/spec/contracts/consumer/resources/api/project/merge_requests.js
2022-08-27 11:52:29 +05:30

34 lines
869 B
JavaScript

import axios from 'axios';
export async function getDiffsMetadata(endpoint) {
const { url } = endpoint;
return axios({
method: 'GET',
baseURL: url,
url: '/gitlab-org/gitlab-qa/-/merge_requests/1/diffs_metadata.json',
headers: { Accept: '*/*' },
}).then((response) => response.data);
}
export async function getDiscussions(endpoint) {
const { url } = endpoint;
return axios({
method: 'GET',
baseURL: url,
url: '/gitlab-org/gitlab-qa/-/merge_requests/1/discussions.json',
headers: { Accept: '*/*' },
}).then((response) => response.data);
}
export async function getDiffsBatch(endpoint) {
const { url } = endpoint;
return axios({
method: 'GET',
baseURL: url,
url: '/gitlab-org/gitlab-qa/-/merge_requests/1/diffs_batch.json?page=0',
headers: { Accept: '*/*' },
}).then((response) => response.data);
}