From 2c8d675c2cf140eac05988065a9d20fd2773399a Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 8 Jul 2021 13:36:39 +0200 Subject: ui: Combine fetching of project relations This change updates the OpenDC frontend to combine the fetching of project relations. This means that for a single project, we make only one additional request to retrieve all its topologies. --- opendc-web/opendc-web-ui/src/api/topologies.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'opendc-web/opendc-web-ui/src/api/topologies.js') diff --git a/opendc-web/opendc-web-ui/src/api/topologies.js b/opendc-web/opendc-web-ui/src/api/topologies.js index 74fc1977..0b8864e0 100644 --- a/opendc-web/opendc-web-ui/src/api/topologies.js +++ b/opendc-web/opendc-web-ui/src/api/topologies.js @@ -26,6 +26,10 @@ export function fetchTopology(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 }) } -- cgit v1.2.3