mirror of
https://github.com/hexastack/hexabot
synced 2025-02-23 04:48:51 +00:00
fix: minor
This commit is contained in:
parent
06906c4fcd
commit
c9e846e834
@ -65,9 +65,7 @@ export const ContentTypeDialog: FC<ContentTypeDialogProps> = ({
|
||||
toast.success(t("message.success_save"));
|
||||
},
|
||||
});
|
||||
const { mutateAsync: updateContentType } = useUpdate(
|
||||
EntityType.CONTENT_TYPE,
|
||||
{
|
||||
const { mutate: updateContentType } = useUpdate(EntityType.CONTENT_TYPE, {
|
||||
onError: () => {
|
||||
toast.error(t("message.internal_server_error"));
|
||||
},
|
||||
@ -75,8 +73,7 @@ export const ContentTypeDialog: FC<ContentTypeDialogProps> = ({
|
||||
closeDialog();
|
||||
toast.success(t("message.success_save"));
|
||||
},
|
||||
},
|
||||
);
|
||||
});
|
||||
const onSubmitForm = async (params) => {
|
||||
if (data) {
|
||||
updateContentType({ id: data.id, params });
|
||||
@ -93,7 +90,7 @@ export const ContentTypeDialog: FC<ContentTypeDialogProps> = ({
|
||||
if (data) {
|
||||
reset({
|
||||
name: data.name,
|
||||
fields: data.fields || [],
|
||||
fields: data.fields || FIELDS_FORM_DEFAULT_VALUES,
|
||||
});
|
||||
} else {
|
||||
reset();
|
||||
|
Loading…
Reference in New Issue
Block a user