summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/api/routes/portfolios.js
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-web/opendc-web-ui/src/api/routes/portfolios.js')
-rw-r--r--opendc-web/opendc-web-ui/src/api/routes/portfolios.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/opendc-web/opendc-web-ui/src/api/routes/portfolios.js b/opendc-web/opendc-web-ui/src/api/routes/portfolios.js
new file mode 100644
index 00000000..7c9ea02a
--- /dev/null
+++ b/opendc-web/opendc-web-ui/src/api/routes/portfolios.js
@@ -0,0 +1,42 @@
+import { deleteById, getById } from './util'
+import { sendRequest } from '../index'
+
+export function addPortfolio(projectId, portfolio) {
+ return sendRequest({
+ path: '/projects/{projectId}/portfolios',
+ method: 'POST',
+ parameters: {
+ body: {
+ portfolio,
+ },
+ path: {
+ projectId,
+ },
+ query: {},
+ },
+ })
+}
+
+export function getPortfolio(portfolioId) {
+ return getById('/portfolios/{portfolioId}', { portfolioId })
+}
+
+export function updatePortfolio(portfolioId, portfolio) {
+ return sendRequest({
+ path: '/portfolios/{projectId}',
+ method: 'POST',
+ parameters: {
+ body: {
+ portfolio,
+ },
+ path: {
+ portfolioId,
+ },
+ query: {},
+ },
+ })
+}
+
+export function deletePortfolio(portfolioId) {
+ return deleteById('/portfolios/{portfolioId}', { portfolioId })
+}