Skip to content

Commit

Permalink
fix: adjust path to public folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ericrallen committed Feb 7, 2022
1 parent e450a0d commit c8a672a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/services/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import type { FullUserProfile } from '../../types/user'
export const getUserAvatar = async (
userId: definitions['profiles']['id']
): Promise<string | null> => {
const { publicURL, error } = await supabase.storage.from('avatars').getPublicUrl(`${userId}.png`)
const { publicURL, error } = await supabase.storage
.from('avatars')
.getPublicUrl(`public/${userId}.png`)

if (error !== null) {
if (process.env.NEXT_PUBLIC_FEATURE__DEBUG_LOGS === 'ENABLED') {
Expand Down Expand Up @@ -37,7 +39,7 @@ export const updateUserAvatar = async ({
.then((blob) => {
supabase.storage
.from('avatars')
.upload(`${userId}.png`, blob, {
.upload(`public/${userId}.png`, blob, {
cacheControl: '3600',
upsert: true,
})
Expand Down

0 comments on commit c8a672a

Please sign in to comment.