Skip to content

Commit de178e7

Browse files
committed
fix: replace randomUUID with crypto.randomUUID for custom file IDs in UploadThing example
1 parent b481f13 commit de178e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/minimal-convex/convex/uploadthing.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
createInternalAction,
77
createUploadthing,
88
FileRouter,
9+
UTFiles,
910
} from "uploadthing/convex";
1011

1112
import { api } from "./_generated/api";
@@ -52,7 +53,7 @@ const router = {
5253
// (Optional) Label your files with a custom identifier
5354
const filesWithMyIds = files.map((file, idx) => ({
5455
...file,
55-
customId: `${idx}-${randomUUID()}`,
56+
customId: `${idx}-${crypto.randomUUID()}`,
5657
}));
5758

5859
// Return some metadata to be stored with the file

0 commit comments

Comments
 (0)