chore: only set visibility for container particles

This commit is contained in:
talksik
2026-03-18 08:48:38 -07:00
parent 990137b829
commit 2c2e56d5e9
2 changed files with 6 additions and 7 deletions
-4
View File
@@ -92,7 +92,6 @@ export async function createParticle<T extends ParticleType>(
type: T,
properties: ParticlePropertiesMap[T],
createdByEmail: string,
visibleTo: string[],
): Promise<string> {
const particle: Particle = ParticleSchema.parse({
id: "", // ignored by toFirestore, but needed to satisfy the type
@@ -101,7 +100,6 @@ export async function createParticle<T extends ParticleType>(
created_at: new Date(),
created_by_email: createdByEmail,
updated_at: null,
visible_to: visibleTo,
});
const ref = await addDoc(typedCollection(collectionPath), particle);
return ref.id;
@@ -111,7 +109,6 @@ export async function createParticle<T extends ParticleType>(
export async function updateParticle<T extends ParticleType>(
docPath: string,
properties: Partial<ParticlePropertiesMap[T]>,
visibleTo?: string[],
): Promise<void> {
const particleRef = typedDoc(docPath);
// Take the partial and create a new object with dot notation
@@ -123,6 +120,5 @@ export async function updateParticle<T extends ParticleType>(
await updateDoc(particleRef, {
...updatedProperties,
updated_at: serverTimestamp(),
...(visibleTo ? { visible_to: visibleTo } : {}),
});
}