summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/api/topologies.js
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-web/opendc-web-ui/src/api/topologies.js')
-rw-r--r--opendc-web/opendc-web-ui/src/api/topologies.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/opendc-web/opendc-web-ui/src/api/topologies.js b/opendc-web/opendc-web-ui/src/api/topologies.js
index 802be4bb..0b8864e0 100644
--- a/opendc-web/opendc-web-ui/src/api/topologies.js
+++ b/opendc-web/opendc-web-ui/src/api/topologies.js
@@ -22,16 +22,20 @@
import { request } from './index'
-export function addTopology(auth, topology) {
- return request(auth, `projects/${topology.projectId}/topologies`, 'POST', { topology })
+export function fetchTopology(auth, topologyId) {
+ return request(auth, `topologies/${topologyId}`)
}
-export function getTopology(auth, topologyId) {
- return request(auth, `topologies/${topologyId}`)
+export function fetchTopologiesOfProject(auth, projectId) {
+ return request(auth, `projects/${projectId}/topologies`)
+}
+
+export function addTopology(auth, topology) {
+ return request(auth, `projects/${topology.projectId}/topologies`, 'POST', { topology })
}
export function updateTopology(auth, topology) {
- const { _id, ...data } = topology;
+ const { _id, ...data } = topology
return request(auth, `topologies/${topology._id}`, 'PUT', { topology: data })
}