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 committed Jun 13, 2024
1 parent 930f23e commit 012c7d1
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 012c7d1

Please sign in to comment.