mirror of
https://github.com/Xevion/rdap.git
synced 2025-12-11 18:08:11 -06:00
Set target on change automatically, set response to null on exception
This commit is contained in:
@@ -38,13 +38,15 @@ const Index: NextPage = () => {
|
|||||||
<div className="mx-auto max-w-screen-sm px-5 lg:max-w-screen-md xl:max-w-screen-lg">
|
<div className="mx-auto max-w-screen-sm px-5 lg:max-w-screen-md xl:max-w-screen-lg">
|
||||||
<div className="dark container mx-auto w-full py-6 md:py-12 ">
|
<div className="dark container mx-auto w-full py-6 md:py-12 ">
|
||||||
<LookupInput
|
<LookupInput
|
||||||
onRegistry={async (type) => {
|
onChange={(target) => {
|
||||||
// await setTarget(type);
|
setTarget(target);
|
||||||
}}
|
}}
|
||||||
onSubmit={async (props) => {
|
onSubmit={async (props) => {
|
||||||
setTarget(props.target);
|
try {
|
||||||
const response = await submit(props);
|
setResponse(await submit(props));
|
||||||
setResponse(response);
|
} catch (e) {
|
||||||
|
setResponse(null);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{error != null ? (
|
{error != null ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user