Skip to content

Commit

Permalink
Merge pull request #8 from InterwebAlchemy/feature/user-avatar-directory
Browse files Browse the repository at this point in the history
fix: move to user id-named directories for avatar hosting
  • Loading branch information
ericrallen authored Feb 7, 2022
2 parents dde210e + 29e2563 commit d3c003d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const getUserAvatar = async (
): Promise<string | null> => {
const { publicURL, error } = await supabase.storage
.from('avatars')
.getPublicUrl(`public/${userId}.png`)
.getPublicUrl(`public/${userId}/avatar.png`)

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

1 comment on commit d3c003d

@ericrallen
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for work-with-me ready!

✅ Preview
https://work-with-me-i7ge21vry-interweb-alchemy.vercel.app
https://work-with-me.vercel.app

Built with commit d3c003d.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.