Skip to content

Commit

Permalink
chore: remove requets log in tss example
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge committed Oct 16, 2024
1 parent b99e088 commit 74c94c8
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions examples/minimal-tanstack-start/app/server/uploadthing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,18 @@ export const uploadRouter = {
maxFileSize: "8GB",
},
})
.middleware(({ req, files }) => {
// Check some condition based on the incoming requrest
console.log("Request", req);
//^?
.middleware(({ req }) => {
// Check some condition based on the incoming request
// if (!req.headers.get("x-some-header")) {
// throw new Error("x-some-header is required");
// }

// (Optional) Label your files with a custom identifier
const filesWithMyIds = files.map((file, idx) => ({
...file,
customId: `${idx}-HELLO`,
}));

// Return some metadata to be stored with the file
return { foo: "bar" as const, [UTFiles]: filesWithMyIds };
return { foo: "bar" as const };
})
.onUploadComplete(({ file, metadata }) => {
metadata;
// ^?
file.customId;
// ^?
console.log("upload completed", file);
}),
} satisfies FileRouter;
Expand Down

0 comments on commit 74c94c8

Please sign in to comment.