mirror of
https://github.com/Xevion/rdap.git
synced 2025-12-06 21:16:06 -06:00
Fix primary onSubmit invocation to properly use Maybe types
This commit is contained in:
@@ -42,9 +42,13 @@ const Index: NextPage = () => {
|
|||||||
onChange={({ target, targetType }) => {
|
onChange={({ target, targetType }) => {
|
||||||
setTarget(target);
|
setTarget(target);
|
||||||
}}
|
}}
|
||||||
onSubmit={async (props) => {
|
onSubmit={async function (props) {
|
||||||
try {
|
try {
|
||||||
setResponse(await submit(props));
|
const result = await submit(props);
|
||||||
|
if (result.isJust)
|
||||||
|
setResponse(result.value);
|
||||||
|
else
|
||||||
|
setResponse(null);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setResponse(null);
|
setResponse(null);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user