MCPcopy Create free account
hub / github.com/cursor/community-plugins / onSubmit

Function onSubmit

apps/cursor/src/components/forms/edit-plugin-form.tsx:51–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49 });
50
51 const onSubmit = () => {
52 setError(null);
53
54 const validComponents = components.filter((c) => c.name.trim());
55 if (!name.trim() || !description.trim() || validComponents.length === 0) {
56 setError(
57 "Please fill in the plugin name, description, and at least one component with a name.",
58 );
59 return;
60 }
61
62 execute({
63 id: data.id,
64 name: name.trim(),
65 description: description.trim(),
66 logo,
67 repository: repositoryLocked
68 ? (data.repository ?? null)
69 : repository.trim() || null,
70 homepage: homepage.trim() || null,
71 keywords: keywords
72 .split(",")
73 .map((k) => k.trim())
74 .filter(Boolean),
75 // No metadata here: the update action falls back to each component's
76 // previously stored metadata when it is omitted.
77 components: validComponents.map(draftToComponentInput),
78 });
79 };
80
81 const formValid =
82 name.trim().length >= 2 &&

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected