(values: ClusterFormValues)
| 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 |
nothing calls this directly
no test coverage detected