diff --git a/js/src/lib/particle-path.ts b/js/src/lib/particle-path.ts index ba9412d..bcc2f58 100644 --- a/js/src/lib/particle-path.ts +++ b/js/src/lib/particle-path.ts @@ -35,13 +35,13 @@ export function parseParticlePath(path: ParticlePath): { * Convert a ParticlePath to the Firestore document path for that particle. * * Firestore structure: - * /net1 → networks/net1/particles (collection) - * /net1/p1 → networks/net1/particles/p1 (document) - * /net1/p1/p2 → networks/net1/particles/p1/children/p2 (document) + * /net1 → networks/net1/children (collection) + * /net1/p1 → networks/net1/children/p1 (document) + * /net1/p1/p2 → networks/net1/children/p1/children/p2 (document) */ export function toFirestoreDocPath(path: ParticlePath): string { const { networkId, segments } = parseParticlePath(path); - const base = `networks/${networkId}/particles`; + const base = `networks/${networkId}/children`; if (segments.length === 0) return base; const parts: string[] = [base, segments[0]]; @@ -54,9 +54,9 @@ export function toFirestoreDocPath(path: ParticlePath): string { /** * Convert a ParticlePath to the Firestore collection path for its children. * - * /net1 → networks/net1/particles (root particles) - * /net1/p1 → networks/net1/particles/p1/children - * /net1/p1/p2 → networks/net1/particles/p1/children/p2/children + * /net1 → networks/net1/children (root particles) + * /net1/p1 → networks/net1/children/p1/children + * /net1/p1/p2 → networks/net1/children/p1/children/p2/children */ export function toFirestoreChildrenPath(path: ParticlePath): string { const { segments } = parseParticlePath(path);