From f9a1ebb048444e2ddc93fcc28b66203f5b8a2acc Mon Sep 17 00:00:00 2001 From: Paul Copplestone Date: Thu, 27 May 2021 20:02:30 +0800 Subject: [PATCH] patches error on single() call --- web/docs/guides/with-nextjs.mdx | 2 +- web/docs/guides/with-react.mdx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/docs/guides/with-nextjs.mdx b/web/docs/guides/with-nextjs.mdx index 5aed3cda538..ff2d1cbef09 100644 --- a/web/docs/guides/with-nextjs.mdx +++ b/web/docs/guides/with-nextjs.mdx @@ -294,7 +294,7 @@ export default function Account({ session }) { .eq('id', user.id) .single() - if (error) { + if (error && status != 416) { throw error } diff --git a/web/docs/guides/with-react.mdx b/web/docs/guides/with-react.mdx index 436722b6835..16e16de77c8 100644 --- a/web/docs/guides/with-react.mdx +++ b/web/docs/guides/with-react.mdx @@ -286,13 +286,13 @@ export default function Account({ session }) { setLoading(true) const user = supabase.auth.user() - let { data, error } = await supabase + let { data, error, status } = await supabase .from('profiles') .select(`username, website, avatar_url`) .eq('id', user.id) .single() - if (error) { + if (error && status != 416) { throw error }