refactor: use path util

This commit is contained in:
2025-09-16 23:18:53 +00:00
parent 691798c56d
commit c7fb40e8eb
2 changed files with 5 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
import type { Doc, Id } from "@fileone/convex/_generated/dataModel"
import { joinPath, PATH_SEPARATOR } from "@fileone/path"
import type {
AuthenticatedMutationCtx,
AuthenticatedQueryCtx,
@@ -94,7 +95,7 @@ export async function create(
userId: ctx.user._id,
createdAt: now,
updatedAt: now,
path: parentDir ? `${parentDir.path}/${name}` : "/",
path: parentDir ? joinPath(parentDir.path, name) : PATH_SEPARATOR,
})
}

View File

@@ -2,6 +2,9 @@
"name": "@fileone/convex",
"module": "index.ts",
"type": "module",
"dependencies": {
"@fileone/path": "workspace:*"
},
"peerDependencies": {
"typescript": "^5",
"convex": "^1.27.0"