Skip to content

Commit

Permalink
Fix for eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
samuraikun committed Feb 18, 2024
1 parent 1c9e463 commit 9808c04
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/activity/hooks/useUploadFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { createClient } from '@supabase/supabase-js'
import { useCreateActivityUploadedFilesMutation } from '@generated/api'

export const useUploadFiles = () => {
const [createActivityUploadedFilesMutation] = useCreateActivityUploadedFilesMutation()
const [createActivityUploadedFilesMutation] =
useCreateActivityUploadedFilesMutation()

const uploadFiles = async (
files: File[],
Expand Down Expand Up @@ -36,7 +37,11 @@ export const useUploadFiles = () => {
const results = uploadResults.map((result) => result)
const dataWithPublicUrls = await Promise.all(
results.map((result) => {
const { data: { publicUrl } } = supabase.storage.from(process.env.NEXT_PUBLIC_BUCKET_NAME!).getPublicUrl(result.data!.path!)
const {
data: { publicUrl }
} = supabase.storage
.from(process.env.NEXT_PUBLIC_BUCKET_NAME!)
.getPublicUrl(result.data!.path!)

return { publicUrl, fileName: result.fileName }
})
Expand All @@ -48,7 +53,7 @@ export const useUploadFiles = () => {
objects: dataWithPublicUrls.map((data) => ({
activity_id: activityDetails.id,
file_name: data.fileName,
file_url: data.publicUrl,
file_url: data.publicUrl
}))
},
refetchQueries: ['activityCollection']
Expand Down

0 comments on commit 9808c04

Please sign in to comment.