-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
329 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* eslint-disable import/namespace */ | ||
import { createNextPageApiHandler } from "uploadthing/next-legacy"; | ||
import { ourFileRouter } from "@/server/uploadthing"; | ||
|
||
const handler = createNextPageApiHandler({ | ||
router: ourFileRouter, | ||
}); | ||
|
||
export default handler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { createUploadthing, type FileRouter } from "uploadthing/next-legacy"; | ||
|
||
const f = createUploadthing(); | ||
|
||
export const ourFileRouter = { | ||
// Router for uploading documents | ||
kycDocumentUploader: f({ | ||
image: { maxFileCount: 5 }, | ||
pdf: { maxFileCount: 5 }, | ||
}).onUploadComplete(async ({ file }) => { | ||
console.log("file url", file.url); | ||
}), | ||
} satisfies FileRouter; | ||
|
||
export type OurFileRouter = typeof ourFileRouter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* eslint-disable import/namespace */ | ||
import { generateComponents } from "@uploadthing/react"; | ||
import type { OurFileRouter } from "@/server/uploadthing"; | ||
|
||
export const { UploadButton, UploadDropzone, Uploader } = | ||
generateComponents<OurFileRouter>(); |
Oops, something went wrong.