MCPcopy Create free account
hub / github.com/Microck/opencode-studio / handleCreate

Function handleCreate

client-next/src/components/presets-manager.tsx:72–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70 }, [open]);
71
72 const handleCreate = async () => {
73 if (!newName.trim()) return toast.error("Name is required");
74
75 try {
76 await savePreset(newName, newDesc, {
77 skills: includeSkills ? selectedSkills : undefined,
78 plugins: includePlugins ? selectedPlugins : undefined,
79 mcps: includeMcps ? selectedMcps : undefined,
80 commands: []
81 });
82 toast.success("Preset created");
83 setCreateOpen(false);
84 setNewName("");
85 setNewDesc("");
86 loadPresets();
87 } catch (err: any) {
88 const msg = err?.response?.data?.error || err?.message || "Unknown error";
89 toast.error(`Failed to create preset: ${msg}`);
90 }
91 };
92
93 const handleApply = async (id: string, mode: 'exclusive' | 'additive') => {
94 try {

Callers

nothing calls this directly

Calls 2

savePresetFunction · 0.90
loadPresetsFunction · 0.85

Tested by

no test coverage detected