feat: add mime type field to files

This commit is contained in:
2025-09-14 18:49:28 +00:00
parent 59402f473f
commit 27c8d72a5b
4 changed files with 10 additions and 2 deletions

View File

@@ -48,8 +48,12 @@ export const saveFile = mutation({
directoryId: v.optional(v.id("directories")),
storageId: v.id("_storage"),
userId: v.id("users"),
mimeType: v.optional(v.string()),
},
handler: async (ctx, { name, storageId, directoryId, userId, size }) => {
handler: async (
ctx,
{ name, storageId, directoryId, userId, size, mimeType },
) => {
const now = new Date().toISOString()
await ctx.db.insert("files", {
name,
@@ -57,6 +61,7 @@ export const saveFile = mutation({
storageId,
directoryId,
userId,
mimeType,
createdAt: now,
updatedAt: now,
})