feat: make file upload dir id required
This commit is contained in:
@@ -68,7 +68,7 @@ export const saveFile = authenticatedMutation({
|
||||
args: {
|
||||
name: v.string(),
|
||||
size: v.number(),
|
||||
directoryId: v.optional(v.id("directories")),
|
||||
directoryId: v.id("directories"),
|
||||
storageId: v.id("_storage"),
|
||||
mimeType: v.optional(v.string()),
|
||||
},
|
||||
|
@@ -85,6 +85,7 @@ function FilePathBreadcrumb({ path }: { path: string }) {
|
||||
|
||||
// tags: upload, uploadfile, uploadfilebutton, fileupload, fileuploadbutton
|
||||
function UploadFileButton() {
|
||||
const { directory } = useContext(DirectoryPageContext)
|
||||
const generateUploadUrl = useConvexMutation(api.files.generateUploadUrl)
|
||||
const saveFile = useConvexMutation(api.files.saveFile)
|
||||
const { mutate: uploadFile, isPending: isUploading } = useMutation({
|
||||
@@ -104,6 +105,7 @@ function UploadFileButton() {
|
||||
name: file.name,
|
||||
size: file.size,
|
||||
mimeType: file.type,
|
||||
directoryId: directory._id,
|
||||
})
|
||||
},
|
||||
onSuccess: () => {
|
||||
|
Reference in New Issue
Block a user