Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Replace let with const in .mdx file (#18210)

Mohammed Yasin Mullab09243b628c4
diff --git a/apps/docs/pages/guides/auth.mdx b/apps/docs/pages/guides/auth.mdx
index 2a516ff35ea..b92f5c23ab4 100644
--- a/apps/docs/pages/guides/auth.mdx
+++ b/apps/docs/pages/guides/auth.mdx
@@ -104,7 +104,7 @@ With policies, your database becomes the rules engine. Instead of repetitively f
```js
const loggedInUserId = 'd0714948'
-let { data, error } = await supabase
+const { data, error } = await supabase
.from('users')
.select('user_id, name')
.eq('user_id', loggedInUserId)
@@ -116,7 +116,7 @@ let { data, error } = await supabase
... you can simply define a rule on your database table, `auth.uid() = user_id`, and your request will return the rows which pass the rule, even when you remove the filter from your middleware:
```js
-let { data, error } = await supabase.from('users').select('user_id, name')
+const { data, error } = await supabase.from('users').select('user_id, name')
// console.log(data)
// Still => { id: 'd0714948', name: 'Jane' }
diff --git a/apps/docs/pages/guides/auth/auth-helpers/sveltekit.mdx b/apps/docs/pages/guides/auth/auth-helpers/sveltekit.mdx
index 9f815998603..1f28fab4f4d 100644
--- a/apps/docs/pages/guides/auth/auth-helpers/sveltekit.mdx
+++ b/apps/docs/pages/guides/auth/auth-helpers/sveltekit.mdx
@@ -339,7 +339,7 @@ We need to create an event listener in the root `+layout.svelte` file in order t
export let data
- let { supabase, session } = data
+ const { supabase, session } = data
$: ({ supabase, session } = data)
onMount(() => {
@@ -368,7 +368,7 @@ We can access the supabase instance in our `+page.svelte` file through the data
<!-- // src/routes/auth/+page.svelte -->
<script>
export let data
- let { supabase } = data
+ const { supabase } = data
$: ({ supabase } = data)
let email
@@ -685,7 +685,7 @@ For [row level security](https://supabase.com/docs/guides/auth/row-level-securit
<script lang="ts">
export let data
- let { user, tableData } = data
+ const { user, tableData } = data
$: ({ user, tableData } = data)
</script>
diff --git a/apps/docs/pages/guides/auth/phone-login/messagebird.mdx b/apps/docs/pages/guides/auth/phone-login/messagebird.mdx
index 659b108e57f..0227cf473bd 100644
--- a/apps/docs/pages/guides/auth/phone-login/messagebird.mdx
+++ b/apps/docs/pages/guides/auth/phone-login/messagebird.mdx
@@ -88,7 +88,7 @@ In this use scenario we'll be using the user's mobile phone number as an alterna
Using supabase-js on the client you'll want to use the same `signUp` method that you'd use for email based sign ups, but with the `phone` param instead of the `email param`:
```js
-let { user, error } = await supabase.auth.signUp({
+const { user, error } = await supabase.auth.signUp({
phone: '+13334445555',
password: 'some-password',
})
@@ -134,7 +134,7 @@ The user will now receive an SMS with a 6-digit pin that you will need to receiv
You should present a form to the user so they can input the 6 digit pin, then send it along with the phone number to `verifyOtp`:
```js
-let { session, error } = await supabase.auth.verifyOtp({
+const { session, error } = await supabase.auth.verifyOtp({
phone: '+13334445555',
token: '123456',
})
@@ -195,7 +195,7 @@ Also now that the mobile has been verified, the user can use the number and pass
<TabPanel id="js" label="JavaScript">
```js
-let { user, error } = await supabase.auth.signInWithPassword({
+const { user, error } = await supabase.auth.signInWithPassword({
phone: '+13334445555',
password: 'some-password',
})
@@ -243,7 +243,7 @@ In this scenario you are granting your user's the ability to login to their acco
In JavaScript we can use the `signIn` method with a single parameter: `phone`
```js
-let { user, error } = await supabase.auth.signInWithOtp({
+const { user, error } = await supabase.auth.signInWithOtp({
phone: '+13334445555',
})
```
@@ -286,7 +286,7 @@ The second step is the same as the previous section, you need to collect the 6-d
<TabPanel id="js" label="JavaScript">
```js
-let { session, error } = await supabase.auth.verifyOtp({
+const { session, error } = await supabase.auth.verifyOtp({
phone: '+13334445555',
token: '123456',
})
diff --git a/apps/docs/pages/guides/auth/phone-login/twilio.mdx b/apps/docs/pages/guides/auth/phone-login/twilio.mdx
index 4f9f7e721f2..ea7a64eb4a0 100644
--- a/apps/docs/pages/guides/auth/phone-login/twilio.mdx
+++ b/apps/docs/pages/guides/auth/phone-login/twilio.mdx
@@ -134,7 +134,7 @@ In this scenario we'll be using the user's mobile phone number and a correspondi
Using supabase-js on the client you'll want to use the same `signUp` method that you'd use for email based sign ups, but with the `phone` param instead of the `email param`:
```js
-let { user, error } = await supabase.auth.signUp({
+const { user, error } = await supabase.auth.signUp({
phone: '+13334445555',
password: 'some-password',
})
@@ -180,7 +180,7 @@ The user will now receive an SMS with a 6-digit pin that you will need to receiv
You should present a form to the user so they can input the 6 digit pin, then send it along with the phone number to `verifyOtp`:
```js
-let { session, error } = await supabase.auth.verifyOtp({
+const { session, error } = await supabase.auth.verifyOtp({
phone: '+13334445555',
token: '123456',
type: 'sms',
@@ -242,7 +242,7 @@ Also now that the mobile has been verified, the user can use the number and pass
<TabPanel id="js" label="JavaScript">
```js
-let { user, error } = await supabase.auth.signInWithPassword({
+const { user, error } = await supabase.auth.signInWithPassword({
phone: '+13334445555',
password: 'some-password',
})
@@ -290,7 +290,7 @@ In this scenario you are granting your user's the ability to login to their acco
In JavaScript we can use the `signIn` method with a single parameter: `phone`
```js
-let { user, error } = await supabase.auth.signInWithOtp({
+const { user, error } = await supabase.auth.signInWithOtp({
phone: '+13334445555',
})
```
@@ -333,7 +333,7 @@ The second step is the same as the previous section, you need to collect the 6-d
<TabPanel id="js" label="JavaScript">
```js
-let { session, error } = await supabase.auth.verifyOtp({
+const { session, error } = await supabase.auth.verifyOtp({
phone: '+13334445555',
token: '123456',
type: 'sms',
@@ -429,7 +429,7 @@ There is no change in the verification process, you should continue to use the `
```js
// After receiving a WhatsApp OTP
-let { data, error } = await supabase.auth.verifyOtp({
+const { data, error } = await supabase.auth.verifyOtp({
phone: '+57336567365',
token: '123456',
type: 'sms',
diff --git a/apps/docs/pages/guides/auth/phone-login/vonage.mdx b/apps/docs/pages/guides/auth/phone-login/vonage.mdx
index f04563c97de..2e701c5bc6a 100644
--- a/apps/docs/pages/guides/auth/phone-login/vonage.mdx
+++ b/apps/docs/pages/guides/auth/phone-login/vonage.mdx
@@ -81,7 +81,7 @@ In this use scenario we'll be using the user's mobile phone number as an alterna
Using supabase-js on the client you'll want to use the same `signUp` method that you'd use for email based sign ups, but with the `phone` param instead of the `email param`:
```js
-let { user, error } = await supabase.auth.signUp({
+const { user, error } = await supabase.auth.signUp({
phone: '491512223334444',
password: 'some-password',
})
@@ -127,7 +127,7 @@ The user will now receive an SMS with a 6-digit pin that you will need to receiv
You should present a form to the user so they can input the 6 digit pin, then send it along with the phone number to `verifyOtp`:
```js
-let { session, error } = await supabase.auth.verifyOtp({
+const { session, error } = await supabase.auth.verifyOtp({
phone: '491512223334444',
token: '123456',
})
@@ -188,7 +188,7 @@ Also now that the mobile has been verified, the user can use the number and pass
<TabPanel id="js" label="JavaScript">
```js
-let { user, error } = await supabase.auth.signInWithPassword({
+const { user, error } = await supabase.auth.signInWithPassword({
phone: '491512223334444',
password: 'some-password',
})
@@ -236,7 +236,7 @@ In this scenario you are granting your user's the ability to login to their acco
In JavaScript we can use the `signIn` method with a single parameter: `phone`
```js
-let { user, error } = await supabase.auth.signInWithOtp({
+const { user, error } = await supabase.auth.signInWithOtp({
phone: '491512223334444',
})
```
@@ -279,7 +279,7 @@ The second step is the same as the previous section, you need to collect the 6-d
<TabPanel id="js" label="JavaScript">
```js
-let { session, error } = await supabase.auth.verifyOtp({
+const { session, error } = await supabase.auth.verifyOtp({
phone: '491512223334444',
token: '123456',
})
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-angular.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-angular.mdx
index b46ffb7f967..2c63525d177 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-angular.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-angular.mdx
@@ -246,7 +246,7 @@ export class AccountComponent implements OnInit {
try {
this.loading = true
const { user } = this.session
- let { data: profile, error, status } = await this.supabase.profile(user)
+ const { data: profile, error, status } = await this.supabase.profile(user)
if (error && status !== 406) {
throw error
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-expo-react-native.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-expo-react-native.mdx
index 846385d21f4..461a5cd6563 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-expo-react-native.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-expo-react-native.mdx
@@ -276,7 +276,7 @@ export default function Account({ session }: { session: Session }) {
setLoading(true)
if (!session?.user) throw new Error('No user on the session!')
- let { data, error, status } = await supabase
+ const { data, error, status } = await supabase
.from('profiles')
.select(`username, website, avatar_url`)
.eq('id', session?.user.id)
@@ -320,7 +320,7 @@ export default function Account({ session }: { session: Session }) {
updated_at: new Date(),
}
- let { error } = await supabase.from('profiles').upsert(updates)
+ const { error } = await supabase.from('profiles').upsert(updates)
if (error) {
throw error
@@ -501,7 +501,7 @@ export default function Avatar({ url, size = 150, onUpload }: Props) {
const fileExt = file.name.split('.').pop()
const filePath = `${Math.random()}.${fileExt}`
- let { error } = await supabase.storage.from('avatars').upload(filePath, formData)
+ const { error } = await supabase.storage.from('avatars').upload(filePath, formData)
if (error) {
throw error
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-ionic-angular.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-ionic-angular.mdx
index f381c1ec529..8ff49b546bc 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-ionic-angular.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-ionic-angular.mdx
@@ -256,7 +256,7 @@ export class AccountPage implements OnInit {
async getProfile() {
try {
- let { data: profile, error, status } = await this.supabase.profile
+ const { data: profile, error, status } = await this.supabase.profile
if (error && status !== 406) {
throw error
}
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-ionic-react.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-ionic-react.mdx
index fbb17ca5464..30b63a1b197 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-ionic-react.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-ionic-react.mdx
@@ -176,7 +176,7 @@ export function AccountPage() {
await showLoading();
try {
const user = supabase.auth.user();
- let { data, error, status } = await supabase
+ const { data, error, status } = await supabase
.from('profiles')
.select(`username, website, avatar_url`)
.eq('id', user!.id)
@@ -219,7 +219,7 @@ export function AccountPage() {
updated_at: new Date(),
};
- let { error } = await supabase.from('profiles').upsert(updates, {
+ const { error } = await supabase.from('profiles').upsert(updates, {
returning: 'minimal', // Don't return the value after inserting
});
@@ -430,7 +430,7 @@ export function Avatar({
const fileName = `${Math.random()}-${new Date().getTime()}.${
photo.format
}`;
- let { error: uploadError } = await supabase.storage
+ const { error: uploadError } = await supabase.storage
.from('avatars')
.upload(fileName, file);
if (uploadError) {
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-ionic-vue.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-ionic-vue.mdx
index b58717103ae..41b58ec9290 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-ionic-vue.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-ionic-vue.mdx
@@ -239,7 +239,7 @@ Let's create a new component for that called `Account.vue`.
const toast = await toastController.create({ duration: 5000 })
await loader.present()
try {
- let { data, error, status } = await supabase
+ const { data, error, status } = await supabase
.from('profiles')
.select(`username, website, avatar_url`)
.eq('id', user.id)
@@ -274,7 +274,7 @@ Let's create a new component for that called `Account.vue`.
updated_at: new Date(),
}
//
- let { error } = await supabase.from('profiles').upsert(updates, {
+ const { error } = await supabase.from('profiles').upsert(updates, {
returning: 'minimal', // Don't return the value after inserting
})
//
@@ -292,7 +292,7 @@ Let's create a new component for that called `Account.vue`.
const toast = await toastController.create({ duration: 5000 })
await loader.present()
try {
- let { error } = await supabase.auth.signOut()
+ const { error } = await supabase.auth.signOut()
if (error) throw error
} catch (error: any) {
toast.message = error.message
@@ -472,7 +472,7 @@ Then create an **AvatarComponent**.
.then((blob) => new File([blob], 'my-file', { type: `image/${photo.format}` }))
const fileName = `${Math.random()}-${new Date().getTime()}.${photo.format}`
- let { error: uploadError } = await supabase.storage
+ const { error: uploadError } = await supabase.storage
.from('avatars')
.upload(fileName, file)
if (uploadError) {
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-nextjs.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-nextjs.mdx
index 4256746a62b..f658824ecba 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-nextjs.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-nextjs.mdx
@@ -437,7 +437,7 @@ export default function AccountForm({ session }) {
try {
setLoading(true)
- let { data, error, status } = await supabase
+ const { data, error, status } = await supabase
.from('profiles')
.select(`full_name, username, website, avatar_url`)
.eq('id', user?.id)
@@ -468,7 +468,7 @@ export default function AccountForm({ session }) {
try {
setLoading(true)
- let { error } = await supabase.from('profiles').upsert({
+ const { error } = await supabase.from('profiles').upsert({
id: user?.id,
full_name: fullname,
username,
@@ -563,7 +563,7 @@ export default function AccountForm({ session }: { session: Session | null }) {
try {
setLoading(true)
- let { data, error, status } = await supabase
+ const { data, error, status } = await supabase
.from('profiles')
.select(`full_name, username, website, avatar_url`)
.eq('id', user?.id)
@@ -603,7 +603,7 @@ export default function AccountForm({ session }: { session: Session | null }) {
try {
setLoading(true)
- let { error } = await supabase.from('profiles').upsert({
+ const { error } = await supabase.from('profiles').upsert({
id: user?.id as string,
full_name: fullname,
username,
@@ -799,7 +799,7 @@ export default function Avatar({ uid, url, size, onUpload }) {
const fileExt = file.name.split('.').pop()
const filePath = `${uid}-${Math.random()}.${fileExt}`
- let { error: uploadError } = await supabase.storage.from('avatars').upload(filePath, file)
+ const { error: uploadError } = await supabase.storage.from('avatars').upload(filePath, file)
if (uploadError) {
throw uploadError
@@ -904,7 +904,7 @@ export default function Avatar({
const fileExt = file.name.split('.').pop()
const filePath = `${uid}-${Math.random()}.${fileExt}`
- let { error: uploadError } = await supabase.storage.from('avatars').upload(filePath, file)
+ const { error: uploadError } = await supabase.storage.from('avatars').upload(filePath, file)
if (uploadError) {
throw uploadError
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-nuxt-3.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-nuxt-3.mdx
index 1be2aa21b06..29392ce681d 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-nuxt-3.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-nuxt-3.mdx
@@ -128,7 +128,7 @@ const avatar_path = ref('')
loading.value = true
const user = useSupabaseUser()
-let { data } = await supabase
+const { data } = await supabase
.from('profiles')
.select(`username, website, avatar_url`)
.eq('id', user.value.id)
@@ -155,7 +155,7 @@ async function updateProfile() {
updated_at: new Date(),
}
- let { error } = await supabase.from('profiles').upsert(updates, {
+ const { error } = await supabase.from('profiles').upsert(updates, {
returning: 'minimal', // Don't return the value after inserting
})
if (error) throw error
@@ -169,7 +169,7 @@ async function updateProfile() {
async function signOut() {
try {
loading.value = true
- let { error } = await supabase.auth.signOut()
+ const { error } = await supabase.auth.signOut()
if (error) throw error
user.value = null
} catch (error) {
@@ -283,7 +283,7 @@ const uploadAvatar = async (evt) => {
const fileName = `${Math.random()}.${fileExt}`
const filePath = `${fileName}`
- let { error: uploadError } = await supabase.storage.from('avatars').upload(filePath, file)
+ const { error: uploadError } = await supabase.storage.from('avatars').upload(filePath, file)
if (uploadError) throw uploadError
@@ -349,7 +349,7 @@ const avatar_path = ref('')
loading.value = true
const user = useSupabaseUser()
-let { data } = await supabase
+const { data } = await supabase
.from('profiles')
.select(`username, website, avatar_url`)
.eq('id', user.value.id)
@@ -376,7 +376,7 @@ async function updateProfile() {
updated_at: new Date(),
}
- let { error } = await supabase.from('profiles').upsert(updates, {
+ const { error } = await supabase.from('profiles').upsert(updates, {
returning: 'minimal', // Don't return the value after inserting
})
@@ -391,7 +391,7 @@ async function updateProfile() {
async function signOut() {
try {
loading.value = true
- let { error } = await supabase.auth.signOut()
+ const { error } = await supabase.auth.signOut()
if (error) throw error
} catch (error) {
alert(error.message)
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-react.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-react.mdx
index 18030dc0b6e..6e8fbaf8be9 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-react.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-react.mdx
@@ -138,7 +138,7 @@ export default function Account({ session }) {
setLoading(true)
const { user } = session
- let { data, error } = await supabase
+ const { data, error } = await supabase
.from('profiles')
.select(`username, website, avatar_url`)
.eq('id', user.id)
@@ -172,7 +172,7 @@ export default function Account({ session }) {
updated_at: new Date(),
}
- let { error } = await supabase.from('profiles').upsert(updates)
+ const { error } = await supabase.from('profiles').upsert(updates)
if (error) {
alert(error.message)
@@ -316,7 +316,7 @@ export default function Avatar({ url, size, onUpload }) {
const fileName = `${Math.random()}.${fileExt}`
const filePath = `${fileName}`
- let { error: uploadError } = await supabase.storage.from('avatars').upload(filePath, file)
+ const { error: uploadError } = await supabase.storage.from('avatars').upload(filePath, file)
if (uploadError) {
throw uploadError
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-redwoodjs.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-redwoodjs.mdx
index 375198da2f4..d1cbff10719 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-redwoodjs.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-redwoodjs.mdx
@@ -320,7 +320,7 @@ const Account = () => {
setLoading(true)
const user = supabase.auth.user()
- let { data, error, status } = await supabase
+ const { data, error, status } = await supabase
.from('profiles')
.select(`username, website, avatar_url`)
.eq('id', user.id)
@@ -355,7 +355,7 @@ const Account = () => {
updated_at: new Date(),
}
- let { error } = await supabase.from('profiles').upsert(updates, {
+ const { error } = await supabase.from('profiles').upsert(updates, {
returning: 'minimal', // Don't return the value after inserting
})
@@ -525,7 +525,7 @@ const Avatar = ({ url, size, onUpload }) => {
const fileName = `${Math.random()}.${fileExt}`
const filePath = `${fileName}`
- let { error: uploadError } = await supabase.storage.from('avatars').upload(filePath, file)
+ const { error: uploadError } = await supabase.storage.from('avatars').upload(filePath, file)
if (uploadError) {
throw uploadError
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-solidjs.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-solidjs.mdx
index 759c23685ce..01056870c24 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-solidjs.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-solidjs.mdx
@@ -146,7 +146,7 @@ const Account: Component<Props> = ({ session }) => {
setLoading(true)
const { user } = session
- let { data, error, status } = await supabase
+ const { data, error, status } = await supabase
.from('profiles')
.select(`username, website, avatar_url`)
.eq('id', user.id)
@@ -185,7 +185,7 @@ const Account: Component<Props> = ({ session }) => {
updated_at: new Date().toISOString(),
}
- let { error } = await supabase.from('profiles').upsert(updates)
+ const { error } = await supabase.from('profiles').upsert(updates)
if (error) {
throw error
@@ -336,7 +336,7 @@ const Avatar: Component<Props> = (props) => {
const fileName = `${Math.random()}.${fileExt}`
const filePath = `${fileName}`
- let { error: uploadError } = await supabase.storage.from('avatars').upload(filePath, file)
+ const { error: uploadError } = await supabase.storage.from('avatars').upload(filePath, file)
if (uploadError) {
throw uploadError
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-svelte.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-svelte.mdx
index ceb11321c74..2dcdea50f93 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-svelte.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-svelte.mdx
@@ -173,7 +173,7 @@ Let's create a new component for that called `Account.svelte`.
updated_at: new Date().toISOString(),
}
- let { error } = await supabase.from('profiles').upsert(updates)
+ const { error } = await supabase.from('profiles').upsert(updates)
if (error) {
throw error
@@ -306,7 +306,7 @@ Let's create an avatar for the user so that they can upload a profile photo. We
const fileExt = file.name.split('.').pop()
const filePath = `${Math.random()}.${fileExt}`
- let { error } = await supabase.storage.from('avatars').upload(filePath, file)
+ const { error } = await supabase.storage.from('avatars').upload(filePath, file)
if (error) {
throw error
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-sveltekit.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-sveltekit.mdx
index b3c30daa25e..1a453197c51 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-sveltekit.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-sveltekit.mdx
@@ -163,7 +163,7 @@ Update your `src/routes/+layout.svelte`:
export let data
- let { supabase, session } = data
+ const { supabase, session } = data
$: ({ supabase, session } = data)
onMount(() => {
@@ -313,7 +313,7 @@ Create a new `src/routes/account/+page.svelte` file with the content below.
export let data
export let form
- let { session, supabase, profile } = data
+ const { session, supabase, profile } = data
$: ({ session, supabase, profile } = data)
let profileForm: HTMLFormElement
@@ -517,7 +517,7 @@ Let's create an avatar for the user so that they can upload a profile photo. We
const fileExt = file.name.split('.').pop()
const filePath = `${Math.random()}.${fileExt}`
- let { error } = await supabase.storage.from('avatars').upload(filePath, file)
+ const { error } = await supabase.storage.from('avatars').upload(filePath, file)
if (error) {
throw error
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-vue-3.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-vue-3.mdx
index 849f25e02b5..d76df485a6a 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-vue-3.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-vue-3.mdx
@@ -141,7 +141,7 @@ async function getProfile() {
loading.value = true
const { user } = session.value
- let { data, error, status } = await supabase
+ const { data, error, status } = await supabase
.from('profiles')
.select(`username, website, avatar_url`)
.eq('id', user.id)
@@ -174,7 +174,7 @@ async function updateProfile() {
updated_at: new Date(),
}
- let { error } = await supabase.from('profiles').upsert(updates)
+ const { error } = await supabase.from('profiles').upsert(updates)
if (error) throw error
} catch (error) {
@@ -187,7 +187,7 @@ async function updateProfile() {
async function signOut() {
try {
loading.value = true
- let { error } = await supabase.auth.signOut()
+ const { error } = await supabase.auth.signOut()
if (error) throw error
} catch (error) {
alert(error.message)
@@ -313,7 +313,7 @@ const uploadAvatar = async (evt) => {
const fileExt = file.name.split('.').pop()
const filePath = `${Math.random()}.${fileExt}`
- let { error: uploadError } = await supabase.storage.from('avatars').upload(filePath, file)
+ const { error: uploadError } = await supabase.storage.from('avatars').upload(filePath, file)
if (uploadError) throw uploadError
emit('update:path', filePath)
diff --git a/apps/docs/pages/learn/auth-deep-dive/auth-row-level-security.mdx b/apps/docs/pages/learn/auth-deep-dive/auth-row-level-security.mdx
index 81424abf45f..c19a7476a9c 100644
--- a/apps/docs/pages/learn/auth-deep-dive/auth-row-level-security.mdx
+++ b/apps/docs/pages/learn/auth-deep-dive/auth-row-level-security.mdx
@@ -63,10 +63,10 @@ You can see that it's possible to freely read from and write to the table by usi
```js
// Writing
-let { data, error } = await supabase.from('leaderboard').insert({ name: 'Bob', score: 99999 })
+const { data, error } = await supabase.from('leaderboard').insert({ name: 'Bob', score: 99999 })
// Reading
-let { data, error } = await supabase
+const { data, error } = await supabase
.from('leaderboard')
.select('name, score')
.order('score', { ascending: false })
diff --git a/apps/www/_blog/2021-03-11-using-supabase-replit.mdx b/apps/www/_blog/2021-03-11-using-supabase-replit.mdx
index 53b83d72c7c..18b6aeb0973 100644
--- a/apps/www/_blog/2021-03-11-using-supabase-replit.mdx
+++ b/apps/www/_blog/2021-03-11-using-supabase-replit.mdx
@@ -79,7 +79,7 @@ supabase.
// or...
// async/await syntax
const main = async() => {
- let { data, error } = supabase
+ const { data, error } = supabase
.from('countries')
.select('*')
.limit(5)