Skip to content

Commit abec61b

Browse files
committed
fix showcase image uploads
1 parent ca62938 commit abec61b

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

src/server/uploadthing.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@ export const uploadRouter = {
3232
return { url: file.ufsUrl }
3333
}),
3434

35-
showcaseUploader: f({
36-
image: {
37-
maxFileSize: '4MB',
38-
maxFileCount: 1,
35+
showcaseUploader: f(
36+
{
37+
image: {
38+
maxFileSize: '4MB',
39+
maxFileCount: 1,
40+
},
3941
},
40-
})
42+
{ awaitServerData: false },
43+
)
4144
.middleware(async ({ req }) => {
4245
const authService = getAuthService()
4346
const user = await authService.getCurrentUser(req)
@@ -48,8 +51,8 @@ export const uploadRouter = {
4851

4952
return { userId: user.userId }
5053
})
51-
.onUploadComplete(async ({ metadata, file }) => {
52-
return { url: file.ufsUrl, uploadedBy: metadata.userId }
54+
.onUploadComplete(async ({ metadata }) => {
55+
return { uploadedBy: metadata.userId }
5356
}),
5457
} satisfies FileRouter
5558

0 commit comments

Comments
 (0)