mirror of
https://github.com/hexastack/hexabot
synced 2025-02-23 04:48:51 +00:00
refactor(frontend): remove async
This commit is contained in:
parent
8e9383a0bd
commit
02368b71a9
@ -166,8 +166,8 @@ export const ContentForm: FC<ComponentFormProps<ContentFormData>> = ({
|
|||||||
isAbsoluteUrl(value) || t("message.url_is_invalid"),
|
isAbsoluteUrl(value) || t("message.url_is_invalid"),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const { mutateAsync: createContent } = useCreate(EntityType.CONTENT);
|
const { mutate: createContent } = useCreate(EntityType.CONTENT);
|
||||||
const { mutateAsync: updateContent } = useUpdate(EntityType.CONTENT);
|
const { mutate: updateContent } = useUpdate(EntityType.CONTENT);
|
||||||
const options = {
|
const options = {
|
||||||
onError: (error: Error) => {
|
onError: (error: Error) => {
|
||||||
rest.onError?.();
|
rest.onError?.();
|
||||||
@ -178,7 +178,7 @@ export const ContentForm: FC<ComponentFormProps<ContentFormData>> = ({
|
|||||||
toast.success(t("message.success_save"));
|
toast.success(t("message.success_save"));
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const onSubmitForm = async (params: IContentAttributes) => {
|
const onSubmitForm = (params: IContentAttributes) => {
|
||||||
if (content) {
|
if (content) {
|
||||||
updateContent(
|
updateContent(
|
||||||
{ id: content.id, params: buildDynamicFields(params, contentType) },
|
{ id: content.id, params: buildDynamicFields(params, contentType) },
|
||||||
|
Loading…
Reference in New Issue
Block a user