MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / postVuegraphs

Function postVuegraphs

frontend/src/utils/apiFunctions.js:309–344  ·  view source on GitHub ↗
({ filename, content })

Source from the content-addressed store, hash-verified

307
308// Save the VueFlow graph
309export async function postVuegraphs({ filename, content }) {
310 try {
311 const response = await fetch(apiUrl('/api/vuegraphs/upload/content'), {
312 method: 'POST',
313 headers: {
314 'Content-Type': 'application/json',
315 },
316 body: JSON.stringify({
317 filename,
318 content
319 })
320 })
321
322 const data = await response.json().catch(() => ({}))
323
324 if (response.ok) {
325 return {
326 success: true,
327 message: data?.message || 'VueFlow graph saved successfully'
328 }
329 }
330
331 return {
332 success: false,
333 status: response.status,
334 detail: data?.detail,
335 message: data?.message || 'Failed to save VueFlow graph'
336 }
337 } catch (error) {
338 console.error('Error saving VueFlow graph:', error)
339 return {
340 success: false,
341 message: 'API error'
342 }
343 }
344}
345
346// Fetch the config schema
347export async function fetchConfigSchema(breadcrumbs) {

Callers

nothing calls this directly

Calls 2

apiUrlFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected