0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00

refactor(console): improve swr error handling that previously omitted (#6021)

This commit is contained in:
Charles Zhao 2024-06-17 11:12:55 +08:00 committed by GitHub
parent d23417e36d
commit 41495a385d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -20,7 +20,7 @@ type Props = {
function ApplicationName({ applicationId, isLink = false }: Props) {
const isAdminConsole = applicationId === adminConsoleApplicationId;
const fetchApi = useApi({ hideErrorToast: true });
const fetchApi = useApi({ hideErrorToast: ['entity.not_found'] });
const fetcher = useSwrFetcher<Application>(fetchApi);
const { data, error } = useSWR<Application, RequestError>(
!isAdminConsole && `api/applications/${applicationId}`,

View file

@ -23,7 +23,7 @@ type Props = {
function UserName({ userId, isLink = false }: Props) {
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
const fetchApi = useApi({ hideErrorToast: true });
const fetchApi = useApi({ hideErrorToast: ['entity.not_found'] });
const fetcher = useSwrFetcher<User>(fetchApi);
const { data, error } = useSWR<User, RequestError>(`api/users/${userId}`, {
fetcher,