Skip to content

Commit

Permalink
fixup! feat: modified add network tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Polybius93 committed Oct 16, 2023
1 parent bdafc9f commit 046572e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/app/features/add-network/add-network.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,29 @@ export function AddNetwork() {
<Formik
initialValues={addNetworkFormValues}
onSubmit={async () => {
setLoading(true);
setError('');

const { name, stacksUrl, bitcoinUrl, key } = formikProps.values;

if (!isValidUrl(stacksUrl)) {
setError('Enter a valid Stacks API URL');
setLoading(false);
return;
}

if (!isValidUrl(bitcoinUrl)) {
setError('Enter a valid Bitcoin API URL');
setLoading(false);
return;
}

if (!key) {
setError('Enter a unique key');
setLoading(false);
return;
}

setLoading(true);
setError('');

const stacksPath = removeTrailingSlash(new URL(formikProps.values.stacksUrl).href);
const bitcoinPath = removeTrailingSlash(new URL(formikProps.values.bitcoinUrl).href);

Expand Down

0 comments on commit 046572e

Please sign in to comment.