Skip to content

Commit

Permalink
nice
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge committed Sep 30, 2024
1 parent 15d6c33 commit 1fd585f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/minimal-appdir/src/server/uploadthing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const uploadRouter = {
},
blob: {
maxFileSize: "8GB",
maxFileCount: 10,
},
})
.middleware(({ req, files }) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/uploadthing/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const isValidFileType = (
routeConfig: ExpandedRouteConfig,
): boolean =>
Micro.runSync(
getTypeFromFileName(file.name, objectKeys(routeConfig)).pipe(
getTypeFromFileName(file.name, objectKeys(routeConfig), file.type).pipe(
Micro.map((type) => file.type.includes(type)),
Micro.orElseSucceed(() => false),
),
Expand All @@ -66,7 +66,7 @@ export const isValidFileSize = (
routeConfig: ExpandedRouteConfig,
): boolean =>
Micro.runSync(
getTypeFromFileName(file.name, objectKeys(routeConfig)).pipe(
getTypeFromFileName(file.name, objectKeys(routeConfig), file.type).pipe(
Micro.flatMap((type) => fileSizeToBytes(routeConfig[type]!.maxFileSize)),
Micro.map((maxFileSize) => file.size <= maxFileSize),
Micro.orElseSucceed(() => false),
Expand Down
2 changes: 1 addition & 1 deletion packages/uploadthing/src/internal/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ const handleUploadAction = (opts: {
filesWithCustomIds,
(file) =>
Effect.map(
getTypeFromFileName(file.name, objectKeys(parsedConfig)),
getTypeFromFileName(file.name, objectKeys(parsedConfig), file.type),
(type) => ({
name: file.name,
size: file.size,
Expand Down

0 comments on commit 1fd585f

Please sign in to comment.