Updated fetch hook API.

This commit is contained in:
Mike Cao 2020-10-09 12:39:03 -07:00
commit 69b317386a
21 changed files with 112 additions and 76 deletions

View file

@ -8,7 +8,7 @@ export default function SharePage() {
const router = useRouter();
const { id } = router.query;
const shareId = id?.[0];
const { data } = useFetch(shareId ? `/api/share/${shareId}` : null);
const { data } = useFetch(`/api/share/${shareId}`, { disabled: !shareId });
if (!data) {
return null;