From 07f0314d430d3ab3dc14ed16ffdc0b34f1340d7a Mon Sep 17 00:00:00 2001 From: myl7 Date: Wed, 18 May 2022 04:10:09 +0800 Subject: [PATCH] fix error report for search result item req --- components/SearchModal.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/components/SearchModal.tsx b/components/SearchModal.tsx index 6061c12..f02c9d4 100644 --- a/components/SearchModal.tsx +++ b/components/SearchModal.tsx @@ -113,12 +113,22 @@ function SearchResultItemTemplate({ } function SearchResultItemLoadRemote({ result }: { result: OdSearchResult[number] }) { - const { data, error }: SWRResponse = useSWR(`/api/item/?id=${result.id}`, fetcher) + const { data, error }: SWRResponse = useSWR( + `/api/item/?id=${result.id}`, + fetcher + ) const { t } = useTranslation() if (error) { - return + return ( + + ) } if (!data) { return (