fix: add new created label to selected label (#136)

This commit is contained in:
Ridham Khandar
2025-08-10 01:05:29 +05:30
committed by GitHub
parent d555546782
commit 4a67afdd3a
4 changed files with 54 additions and 6 deletions

View File

@@ -12,11 +12,14 @@ export function DeleteLabelConfirmation({
labelPublicId: string;
refetch: () => void;
}) {
const { closeModal } = useModal();
const { closeModal, closeModals } = useModal();
const { showPopup } = usePopup();
const deleteLabelMutation = api.label.delete.useMutation({
onSuccess: () => refetch(),
onSuccess: () => {
refetch();
closeModals(2);
},
onError: () =>
showPopup({
header: t`Error deleting label`,
@@ -26,7 +29,6 @@ export function DeleteLabelConfirmation({
});
const handleDeleteLabel = () => {
closeModal();
deleteLabelMutation.mutate({
labelPublicId,
});