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
|
import axios from 'axios';
export async function getProjectPipelines(endpoint) {
const { url } = endpoint;
return axios({
method: 'GET',
baseURL: url,
url: '/gitlab-org/gitlab-qa/-/pipelines.json',
headers: { Accept: '*/*' },
params: {
scope: 'all',
page: 1,
},
}).then((response) => response.data);
}
export async function postProjectPipelines(endpoint) {
const { url } = endpoint;
return axios({
method: 'POST',
baseURL: url,
url: '/gitlab-org/gitlab-qa/-/pipelines',
headers: {
Accept: '*/*',
'Content-Type': 'application/json; charset=utf-8',
},
data: { ref: 'master' },
validateStatus: (status) => {
return status === 302;
},
});
}
|