MCPcopy Create free account
hub / github.com/ShipSecAI/studio / syncTemplates

Function syncTemplates

frontend/src/services/mcpGroupsApi.ts:175–195  ·  view source on GitHub ↗

* Sync group templates from code to database

()

Source from the content-addressed store, hash-verified

173 * Sync group templates from code to database
174 */
175 async syncTemplates(): Promise<{
176 syncedCount: number;
177 createdCount: number;
178 updatedCount: number;
179 templates: string[];
180 }> {
181 const headers = await getApiAuthHeaders();
182 const response = await fetch(`${API_BASE_URL}/api/v1/mcp-groups/sync-templates`, {
183 method: 'POST',
184 headers,
185 });
186
187 if (!response.ok) {
188 const error = await response
189 .json()
190 .catch(() => ({ message: 'Failed to sync group templates' }));
191 throw new Error(error.message || 'Failed to sync group templates');
192 }
193
194 return response.json();
195 },
196
197 /**
198 * Import a specific group template

Callers

nothing calls this directly

Calls 2

getApiAuthHeadersFunction · 0.90
fetchFunction · 0.85

Tested by

no test coverage detected