MCPcopy Create free account
hub / github.com/botbotrobotics/BotBrain / fetchRobots

Function fetchRobots

frontend/src/components/robot-header.tsx:110–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108 // Fetch robots for dropdown
109 useEffect(() => {
110 const fetchRobots = async () => {
111 if (!user || !supabase) return;
112
113 setLoadingRobots(true);
114 try {
115 const { data, error } = await supabase
116 .from('robots')
117 .select('*')
118 .order('is_favorite', { ascending: false })
119 .order('name', { ascending: true });
120
121 if (error) throw error;
122
123 setRobots(data || []);
124 } catch (error) {
125 console.error('Error fetching robots:', error);
126 } finally {
127 setLoadingRobots(false);
128 }
129 };
130
131 fetchRobots();
132 }, [user, supabase]);

Callers 1

RobotHeaderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected