Skip to content

Commit

Permalink
refactor(console): improve swr error handling that previously omitted (
Browse files Browse the repository at this point in the history
  • Loading branch information
charIeszhao authored Jun 17, 2024
1 parent d23417e commit 41495a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/console/src/components/ApplicationName/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
Expand Down
2 changes: 1 addition & 1 deletion packages/console/src/components/UserName/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 41495a3

Please sign in to comment.