fix: transfer group not invalidating path (#1539)

This commit is contained in:
Meier Lukas
2024-11-24 13:45:00 +01:00
committed by GitHub
parent 1c4d4f4e9d
commit 74e1b6b544

View File

@@ -4,6 +4,7 @@ import { useCallback, useState } from "react";
import { Button, useMatches } from "@mantine/core"; import { Button, useMatches } from "@mantine/core";
import { clientApi } from "@homarr/api/client"; import { clientApi } from "@homarr/api/client";
import { revalidatePathActionAsync } from "@homarr/common/client";
import { useConfirmModal, useModalAction } from "@homarr/modals"; import { useConfirmModal, useModalAction } from "@homarr/modals";
import { showErrorNotification, showSuccessNotification } from "@homarr/notifications"; import { showErrorNotification, showSuccessNotification } from "@homarr/notifications";
import { useI18n, useScopedI18n } from "@homarr/translation/client"; import { useI18n, useScopedI18n } from "@homarr/translation/client";
@@ -46,7 +47,7 @@ export const TransferGroupOwnership = ({ group }: TransferGroupOwnershipProps) =
userId: id, userId: id,
}, },
{ {
onSuccess() { async onSuccess() {
setInnerOwnerId(id); setInnerOwnerId(id);
showSuccessNotification({ showSuccessNotification({
title: tRoot("common.notification.transfer.success"), title: tRoot("common.notification.transfer.success"),
@@ -55,6 +56,7 @@ export const TransferGroupOwnership = ({ group }: TransferGroupOwnershipProps) =
user: name, user: name,
}), }),
}); });
await revalidatePathActionAsync(`/manage/users/groups/${group.id}`);
}, },
onError() { onError() {
showErrorNotification({ showErrorNotification({