Properly set target from SubmitProps

This commit is contained in:
2023-05-21 23:19:46 -05:00
parent b0411e0615
commit 74c68ab45b

View File

@@ -6,6 +6,7 @@ import type {
IpNetwork, IpNetwork,
Register, Register,
RootRegistryType, RootRegistryType,
SubmitProps,
TargetType, TargetType,
} from "@/types"; } from "@/types";
import { registryURLs } from "@/constants"; import { registryURLs } from "@/constants";
@@ -172,8 +173,11 @@ const useLookup = (warningHandler?: WarningHandler) => {
} }
} }
async function submit(): Promise<ParsedGeneric | undefined> { async function submit(
props: SubmitProps
): Promise<ParsedGeneric | undefined> {
try { try {
setTarget(props.target);
const response = await submitInternal(); const response = await submitInternal();
if (response == undefined) if (response == undefined)
throw new Error("Internal submission failed to yield any data."); throw new Error("Internal submission failed to yield any data.");