From 06ef19905bd06e6e1167020f8fea67dc6191f0af Mon Sep 17 00:00:00 2001 From: Charles Zhao Date: Wed, 3 Jul 2024 11:44:37 +0800 Subject: [PATCH] fix(console): hide error toast for non-existed application in audit logs (#6168) * fix(console): hide error toast for non-existed application in audit logs * chore: add changeset --- .changeset/good-shrimps-cover.md | 5 +++++ packages/console/src/components/ApplicationName/index.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/good-shrimps-cover.md diff --git a/.changeset/good-shrimps-cover.md b/.changeset/good-shrimps-cover.md new file mode 100644 index 00000000000..6e1c0d6ddae --- /dev/null +++ b/.changeset/good-shrimps-cover.md @@ -0,0 +1,5 @@ +--- +"@logto/console": patch +--- + +fix a regression bug that error toasts pop up in audit log when logs are associated with deleted applications diff --git a/packages/console/src/components/ApplicationName/index.tsx b/packages/console/src/components/ApplicationName/index.tsx index bb3d4e6c151..e537d5d9c0e 100644 --- a/packages/console/src/components/ApplicationName/index.tsx +++ b/packages/console/src/components/ApplicationName/index.tsx @@ -20,7 +20,7 @@ type Props = { function ApplicationName({ applicationId, isLink = false }: Props) { const isAdminConsole = applicationId === adminConsoleApplicationId; - const fetchApi = useApi({ hideErrorToast: ['entity.not_found'] }); + const fetchApi = useApi({ hideErrorToast: ['entity.not_exists_with_id'] }); const fetcher = useSwrFetcher(fetchApi); const { data, error } = useSWR( !isAdminConsole && `api/applications/${applicationId}`,