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:
parent
d23417e36d
commit
41495a385d
2 changed files with 2 additions and 2 deletions
|
@ -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}`,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue