mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix(frontend): remove submitAsync function
This commit is contained in:
parent
dfff8cab10
commit
b7351e532f
@ -6,7 +6,7 @@
|
|||||||
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
|
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { BaseSyntheticEvent, FC, useEffect } from "react";
|
import React, { FC, useEffect } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|
||||||
import { ContentContainer, ContentItem } from "@/app-components/dialogs/";
|
import { ContentContainer, ContentItem } from "@/app-components/dialogs/";
|
||||||
@ -59,13 +59,6 @@ export const CategoryForm: FC<ComponentFormProps<ICategory>> = ({
|
|||||||
createCategory(params);
|
createCategory(params);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const submitAsync = async (e: BaseSyntheticEvent) => {
|
|
||||||
return await new Promise<void>((resolve) => {
|
|
||||||
handleSubmit((params) => {
|
|
||||||
resolve(onSubmitForm(params));
|
|
||||||
})(e);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (data) {
|
if (data) {
|
||||||
@ -80,10 +73,10 @@ export const CategoryForm: FC<ComponentFormProps<ICategory>> = ({
|
|||||||
return (
|
return (
|
||||||
<Wrapper
|
<Wrapper
|
||||||
open={!!WrapperProps?.open}
|
open={!!WrapperProps?.open}
|
||||||
onSubmit={submitAsync}
|
onSubmit={handleSubmit(onSubmitForm)}
|
||||||
{...WrapperProps}
|
{...WrapperProps}
|
||||||
>
|
>
|
||||||
<form onSubmit={submitAsync}>
|
<form onSubmit={handleSubmit(onSubmitForm)}>
|
||||||
<ContentContainer>
|
<ContentContainer>
|
||||||
<ContentItem>
|
<ContentItem>
|
||||||
<Input
|
<Input
|
||||||
|
Loading…
Reference in New Issue
Block a user