diff --git a/web/core/components/issues/issue-detail/label/create-label.tsx b/web/core/components/issues/issue-detail/label/create-label.tsx index 82e37708db..f3175e5e6f 100644 --- a/web/core/components/issues/issue-detail/label/create-label.tsx +++ b/web/core/components/issues/issue-detail/label/create-label.tsx @@ -8,7 +8,7 @@ import { Plus, X, Loader } from "lucide-react"; import { Popover } from "@headlessui/react"; import { IIssueLabel } from "@plane/types"; // hooks -import { Input, TOAST_TYPE, setToast } from "@plane/ui"; +import { Input } from "@plane/ui"; // ui // types import { TLabelOperations } from "./root"; @@ -67,19 +67,11 @@ export const LabelCreate: FC = (props) => { const handleLabel = async (formData: Partial) => { if (!workspaceSlug || !projectId || isSubmitting) return; - try { - const labelResponse = await labelOperations.createLabel(workspaceSlug, projectId, formData); - const currentLabels = [...(values || []), labelResponse.id]; - await labelOperations.updateIssue(workspaceSlug, projectId, issueId, { label_ids: currentLabels }); - handleIsCreateToggle(); - reset(defaultValues); - } catch (error) { - setToast({ - title: "Error!", - type: TOAST_TYPE.ERROR, - message: "Label creation failed. Please try again sometime later.", - }); - } + const labelResponse = await labelOperations.createLabel(workspaceSlug, projectId, formData); + const currentLabels = [...(values || []), labelResponse.id]; + await labelOperations.updateIssue(workspaceSlug, projectId, issueId, { label_ids: currentLabels }); + handleIsCreateToggle(); + reset(defaultValues); }; return ( @@ -160,7 +152,11 @@ export const LabelCreate: FC = (props) => { )} diff --git a/web/core/components/issues/issue-detail/label/root.tsx b/web/core/components/issues/issue-detail/label/root.tsx index efed45ca9b..277bc8849d 100644 --- a/web/core/components/issues/issue-detail/label/root.tsx +++ b/web/core/components/issues/issue-detail/label/root.tsx @@ -67,7 +67,7 @@ export const IssueLabel: FC = observer((props) => { type: TOAST_TYPE.ERROR, message: "Label creation failed", }); - return error; + throw error; } }, }),