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

Method createMission

frontend/src/services/missions.ts:84–109  ·  view source on GitHub ↗
(mission: Omit<MissionInsert, 'user_id'>)

Source from the content-addressed store, hash-verified

82 }
83
84 async createMission(mission: Omit<MissionInsert, 'user_id'>): Promise<Mission> {
85 const { data: { user } } = await this.supabase.auth.getUser();
86
87 if (!user) {
88 throw new Error('User not authenticated');
89 }
90
91 const { data, error } = await this.supabase
92 .from('missions')
93 .insert({
94 ...mission,
95 user_id: user.id
96 })
97 .select()
98 .single();
99
100 if (error) {
101 console.error('Error creating mission:', error);
102 throw error;
103 }
104
105 // Log mission creation
106 await auditLogger.logMissionCreated(data.id, data.name, data.robot_id || undefined);
107
108 return data;
109 }
110
111 async updateMission(id: string, update: MissionUpdate): Promise<Mission> {
112 const { data, error } = await this.supabase

Callers 1

createMissionFunction · 0.80

Calls 1

logMissionCreatedMethod · 0.80

Tested by

no test coverage detected