forked from github/plane
chore: duplicate label alert added
This commit is contained in:
parent
f7cc2eca36
commit
3d5cbaae2a
@ -9,6 +9,7 @@ import { Popover, Transition } from "@headlessui/react";
|
|||||||
import { IssueLabelService } from "services/issue";
|
import { IssueLabelService } from "services/issue";
|
||||||
// hooks
|
// hooks
|
||||||
import useUser from "hooks/use-user";
|
import useUser from "hooks/use-user";
|
||||||
|
import useToast from "hooks/use-toast";
|
||||||
// ui
|
// ui
|
||||||
import { Input } from "@plane/ui";
|
import { Input } from "@plane/ui";
|
||||||
import { IssueLabelSelect } from "../select";
|
import { IssueLabelSelect } from "../select";
|
||||||
@ -57,6 +58,8 @@ export const SidebarLabelSelect: React.FC<Props> = ({
|
|||||||
defaultValues,
|
defaultValues,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { setToastAlert } = useToast();
|
||||||
|
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
|
|
||||||
const { data: issueLabels, mutate: issueLabelMutate } = useSWR<IIssueLabels[]>(
|
const { data: issueLabels, mutate: issueLabelMutate } = useSWR<IIssueLabels[]>(
|
||||||
@ -79,6 +82,14 @@ export const SidebarLabelSelect: React.FC<Props> = ({
|
|||||||
submitChanges({ labels: [...(issueDetails?.labels ?? []), res.id] });
|
submitChanges({ labels: [...(issueDetails?.labels ?? []), res.id] });
|
||||||
|
|
||||||
setCreateLabelForm(false);
|
setCreateLabelForm(false);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
console.log(e);
|
||||||
|
setToastAlert({
|
||||||
|
type: "error",
|
||||||
|
title: "Error!",
|
||||||
|
message: e.error ? e.error : "Something went wrong. Please try again.",
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user