21 lines
524 B
TypeScript
21 lines
524 B
TypeScript
import netTool from "../netTool"
|
|
import { GITLAB_AUTH_HEADER, GITLAB_BASE_URL, gitlabReqWarp } from "./tools"
|
|
|
|
const getDiffs = async (project_id: number, merge_request_iid: number) => {
|
|
const URL = `${GITLAB_BASE_URL}/projects/${project_id}/merge_requests/${merge_request_iid}/changes`
|
|
const res = await gitlabReqWarp(
|
|
() => netTool.get(URL, {}, GITLAB_AUTH_HEADER),
|
|
null
|
|
)
|
|
if (res === null) return null
|
|
return res
|
|
}
|
|
|
|
const mr = {
|
|
getDiffs,
|
|
}
|
|
|
|
export default mr
|
|
|
|
getDiffs(139032, 484).then(console.log)
|