MCPcopy Create free account
hub / github.com/0010aor/FlashNotes / updateLocalCollection

Function updateLocalCollection

frontend/src/data/localDB/collections.ts:30–41  ·  view source on GitHub ↗
(
  id: string,
  updates: Partial<Pick<LocalCollection, 'name' | 'prompt'>>,
)

Source from the content-addressed store, hash-verified

28}
29
30export 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
43export const deleteLocalCollection = async (id: string): Promise<void> => {
44 await db.cards.where('collectionId').equals(id).delete()

Callers

nothing calls this directly

Calls 1

updateMethod · 0.65

Tested by

no test coverage detected