From 1ddbbd3563af77a218020021ea50a8832900b4db Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Tue, 22 Aug 2017 17:08:55 +0200 Subject: Add route logic for construction routes --- src/api/routes/paths.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/api/routes/paths.js (limited to 'src/api/routes/paths.js') diff --git a/src/api/routes/paths.js b/src/api/routes/paths.js new file mode 100644 index 00000000..073cbe7e --- /dev/null +++ b/src/api/routes/paths.js @@ -0,0 +1,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}); +} -- cgit v1.2.3