diff --git a/packages/convex/files.ts b/packages/convex/files.ts index 70d601c..9c46948 100644 --- a/packages/convex/files.ts +++ b/packages/convex/files.ts @@ -1,9 +1,12 @@ -import { v } from "convex/values" import type { Id } from "@fileone/convex/dataModel" -import { authenticatedMutation, authenticatedQuery, authorizedGet } from "./functions" +import { v } from "convex/values" +import { + authenticatedMutation, + authenticatedQuery, + authorizedGet, +} from "./functions" import * as Directories from "./model/directories" import * as Files from "./model/files" -import type { FileSystemItem } from "./shared/filesystem" export const generateUploadUrl = authenticatedMutation({ handler: async (ctx) => { @@ -54,7 +57,7 @@ export const createDirectory = authenticatedMutation({ if (!parentDirectory) { throw new Error("Parent directory not found") } - + return await Directories.create(ctx, { name, parentId: directoryId, @@ -75,7 +78,7 @@ export const saveFile = authenticatedMutation({ if (!directory) { throw new Error("Directory not found") } - + const now = Date.now() await ctx.db.insert("files", { @@ -102,7 +105,7 @@ export const renameFile = authenticatedMutation({ if (!file) { throw new Error("File not found") } - + await Files.renameFile(ctx, { directoryId, itemId, newName }) }, }) diff --git a/packages/convex/model/filesystem.ts b/packages/convex/model/filesystem.ts index bb5697a..a2aa1e0 100644 --- a/packages/convex/model/filesystem.ts +++ b/packages/convex/model/filesystem.ts @@ -1,5 +1,5 @@ import { v } from "convex/values" -import type { Doc, Id } from "@fileone/convex/dataModel" +import type { Doc, Id } from "../_generated/dataModel" import { type AuthenticatedMutationCtx, type AuthenticatedQueryCtx,