mirror of
https://github.com/Xevion/rdap.git
synced 2025-12-06 01:16:00 -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 }) => {
|
||||
setTarget(target);
|
||||
}}
|
||||
onSubmit={async (props) => {
|
||||
onSubmit={async function (props) {
|
||||
try {
|
||||
setResponse(await submit(props));
|
||||
const result = await submit(props);
|
||||
if (result.isJust)
|
||||
setResponse(result.value);
|
||||
else
|
||||
setResponse(null);
|
||||
} catch (e) {
|
||||
setResponse(null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user