refactor: use path util
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import type { Doc, Id } from "@fileone/convex/_generated/dataModel"
|
import type { Doc, Id } from "@fileone/convex/_generated/dataModel"
|
||||||
|
import { joinPath, PATH_SEPARATOR } from "@fileone/path"
|
||||||
import type {
|
import type {
|
||||||
AuthenticatedMutationCtx,
|
AuthenticatedMutationCtx,
|
||||||
AuthenticatedQueryCtx,
|
AuthenticatedQueryCtx,
|
||||||
@@ -94,7 +95,7 @@ export async function create(
|
|||||||
userId: ctx.user._id,
|
userId: ctx.user._id,
|
||||||
createdAt: now,
|
createdAt: now,
|
||||||
updatedAt: now,
|
updatedAt: now,
|
||||||
path: parentDir ? `${parentDir.path}/${name}` : "/",
|
path: parentDir ? joinPath(parentDir.path, name) : PATH_SEPARATOR,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,6 +2,9 @@
|
|||||||
"name": "@fileone/convex",
|
"name": "@fileone/convex",
|
||||||
"module": "index.ts",
|
"module": "index.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"dependencies": {
|
||||||
|
"@fileone/path": "workspace:*"
|
||||||
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": "^5",
|
"typescript": "^5",
|
||||||
"convex": "^1.27.0"
|
"convex": "^1.27.0"
|
||||||
|
Reference in New Issue
Block a user