mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
Merge pull request #1074 from Hexastack/1073-bug---redirection-to-visual-editor-after-creating-a-new-flow
fix(frontend): fix category redirection to the visual editor
This commit is contained in:
commit
61b5765fd6
@ -34,10 +34,12 @@ export const CategoryForm: FC<ComponentFormProps<ICategory>> = ({
|
|||||||
rest.onError?.();
|
rest.onError?.();
|
||||||
toast.error(error || t("message.internal_server_error"));
|
toast.error(error || t("message.internal_server_error"));
|
||||||
},
|
},
|
||||||
onSuccess: (category: ICategory) => {
|
onSuccess: ({ id }: ICategory) => {
|
||||||
rest.onSuccess?.();
|
rest.onSuccess?.();
|
||||||
toast.success(t("message.success_save"));
|
toast.success(t("message.success_save"));
|
||||||
router.push(`/${RouterType.VISUAL_EDITOR}/flows/${category.id}`);
|
if (router.pathname.startsWith(`/${RouterType.VISUAL_EDITOR}`)) {
|
||||||
|
router.push(`/${RouterType.VISUAL_EDITOR}/flows/${id}`);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const { mutate: createCategory } = useCreate(EntityType.CATEGORY, options);
|
const { mutate: createCategory } = useCreate(EntityType.CATEGORY, options);
|
||||||
|
Loading…
Reference in New Issue
Block a user