UNPKG

hcc-imageright-apis

Version:

imageright APIs

25 lines (24 loc) 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDrawers = getDrawers; exports.getDrawerById = getDrawerById; exports.getDrawerByName = getDrawerByName; exports.getDrawersInContainer = getDrawersInContainer; exports.getDrawersInContainerByName = getDrawersInContainerByName; function getDrawers(api) { return api.get('api/drawers').then((res) => Promise.resolve(res.data)); } function getDrawerById(api, id) { return api.get(`api/drawers/${id}`).then((res) => Promise.resolve(res.data)); } function getDrawerByName(api, name) { return api.get(`api/drawers/${name}`).then((res) => Promise.resolve(res.data)); } function getDrawersInContainer(api, containerId) { return api.get(`api/containers/${containerId}/drawers`).then((res) => Promise.resolve(res.data)); } function getDrawersInContainerByName(api, containerId, name) { return api .get(`api/containers/${containerId}/drawers/${name}`) .then((res) => Promise.resolve(res.data)); }