From 4e815c0fed7640a8cbda8a5963b542b3b8208e89 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Mon, 8 Jul 2024 15:28:38 +0530 Subject: [PATCH] fix: issue link error toast alert (#5068) --- .../components/issues/issue-detail-widgets/links/helper.tsx | 4 ++-- web/core/components/issues/issue-detail/links/root.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/core/components/issues/issue-detail-widgets/links/helper.tsx b/web/core/components/issues/issue-detail-widgets/links/helper.tsx index 48370d04cb..f0a6ed3163 100644 --- a/web/core/components/issues/issue-detail-widgets/links/helper.tsx +++ b/web/core/components/issues/issue-detail-widgets/links/helper.tsx @@ -21,9 +21,9 @@ export const useLinkOperations = (workspaceSlug: string, projectId: string, issu type: TOAST_TYPE.SUCCESS, title: "Link created", }); - } catch (error) { + } catch (error: any) { setToast({ - message: "The link could not be created", + message: error?.data?.error ?? "The link could not be created", type: TOAST_TYPE.ERROR, title: "Link not created", }); diff --git a/web/core/components/issues/issue-detail/links/root.tsx b/web/core/components/issues/issue-detail/links/root.tsx index e50244fd43..1450bb4ce0 100644 --- a/web/core/components/issues/issue-detail/links/root.tsx +++ b/web/core/components/issues/issue-detail/links/root.tsx @@ -52,9 +52,9 @@ export const IssueLinkRoot: FC = (props) => { title: "Link created", }); toggleIssueLinkModal(false); - } catch (error) { + } catch (error: any) { setToast({ - message: "The link could not be created", + message: error?.data?.error ?? "The link could not be created", type: TOAST_TYPE.ERROR, title: "Link not created", });