diff options
Diffstat (limited to 'qa/contracts/consumer/endpoints/merge_request.js')
-rw-r--r-- | qa/contracts/consumer/endpoints/merge_request.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/qa/contracts/consumer/endpoints/merge_request.js b/qa/contracts/consumer/endpoints/merge_request.js new file mode 100644 index 00000000000..74fd4e75bec --- /dev/null +++ b/qa/contracts/consumer/endpoints/merge_request.js @@ -0,0 +1,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); +}; |