MCPcopy
hub / github.com/autobase-tech/autobase / onSubmit

Function onSubmit

console/ui/src/widgets/cluster-form/ui/index.tsx:100–119  ·  view source on GitHub ↗
(values: ClusterFormValues)

Source from the content-addressed store, hash-verified

98 };
99
100 const onSubmit = async (values: ClusterFormValues) => {
101 try {
102 if (values[CLUSTER_FORM_FIELD_NAMES.PROVIDER].code === PROVIDERS.LOCAL) await submitLocalCluster(values);
103 else await submitCloudCluster(values);
104 toast.info(
105 t(
106 values[DATABASE_SERVERS_FIELD_NAMES.IS_CLUSTER_EXISTS]
107 ? 'clusterSuccessfullyImported'
108 : 'clusterSuccessfullyCreated',
109 {
110 ns: 'toasts',
111 clusterName: values[CLUSTER_FORM_FIELD_NAMES.CLUSTER_NAME],
112 },
113 ),
114 );
115 await navigate(generateAbsoluteRouterPath(RouterPaths.clusters.absolutePath));
116 } catch (e) {
117 handleRequestErrorCatch(e);
118 }
119 };
120
121 const cancelHandler = () => navigate(generateAbsoluteRouterPath(RouterPaths.clusters.absolutePath));
122

Callers

nothing calls this directly

Calls 4

handleRequestErrorCatchFunction · 0.90
submitLocalClusterFunction · 0.70
submitCloudClusterFunction · 0.70

Tested by

no test coverage detected