summaryrefslogtreecommitdiff
path: root/frontend/src/api/routes/paths.js
blob: 74811ab23015a6c57188d91ab29690441a83f313 (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
import { sendRequest } from '../index'
import { getById } from './util'

export function getPath(pathId) {
    return getById('/paths/{pathId}', { pathId })
}

export function getBranchesOfPath(pathId) {
    return getById('/paths/{pathId}/branches', { pathId })
}

export function branchFromPath(pathId, section) {
    return sendRequest({
        path: '/paths/{pathId}/branches',
        method: 'POST',
        parameters: {
            body: {
                section,
            },
            path: {
                pathId,
            },
            query: {},
        },
    })
}

export function getSectionsOfPath(pathId) {
    return getById('/paths/{pathId}/sections', { pathId })
}