MCPcopy
hub / github.com/OpenBMB/ChatDev / fetchVueGraph

Function fetchVueGraph

frontend/src/utils/apiFunctions.js:280–306  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

278
279// Fetch the VueFlow graph
280export async function fetchVueGraph(key) {
281 try {
282 const response = await fetch(apiUrl(`/api/vuegraphs/${encodeURIComponent(key)}`))
283 const data = await response.json().catch(() => ({}))
284
285 if (response.ok) {
286 return {
287 success: true,
288 content: data?.content,
289 status: response.status
290 }
291 }
292
293 return {
294 success: false,
295 status: response.status,
296 detail: data?.detail,
297 message: data?.message || 'Failed to fetch VueFlow graph'
298 }
299 } catch (error) {
300 console.error('Error fetching VueFlow graph:', error)
301 return {
302 success: false,
303 message: 'API error'
304 }
305 }
306}
307
308// Save the VueFlow graph
309export async function postVuegraphs({ filename, content }) {

Callers

nothing calls this directly

Calls 2

apiUrlFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected