Function
updateLocalCollection
(
id: string,
updates: Partial<Pick<LocalCollection, 'name' | 'prompt'>>,
)
Source from the content-addressed store, hash-verified
| 28 | } |
| 29 | |
| 30 | export const updateLocalCollection = async ( |
| 31 | id: string, |
| 32 | updates: Partial<Pick<LocalCollection, 'name' | 'prompt'>>, |
| 33 | ): Promise<number> => { |
| 34 | const collection = await db.collections.get(id) |
| 35 | if (!collection) throw new Error('Collection not found for update') |
| 36 | return await db.collections.update(id, { |
| 37 | ...updates, |
| 38 | updatedAt: Date.now(), |
| 39 | synced: false, |
| 40 | }) |
| 41 | } |
| 42 | |
| 43 | export const deleteLocalCollection = async (id: string): Promise<void> => { |
| 44 | await db.cards.where('collectionId').equals(id).delete() |
Callers
nothing calls this directly
Tested by
no test coverage detected