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

Function deleteLocalCollection

frontend/src/data/localDB/collections.ts:43–52  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

41}
42
43export const deleteLocalCollection = async (id: string): Promise<void> => {
44 await db.cards.where('collectionId').equals(id).delete()
45 const sessions = await db.practice_sessions.where('collectionId').equals(id).toArray()
46 const sessionIds = sessions.map((session) => session.id)
47 if (sessionIds.length > 0) {
48 await db.practice_cards.where('sessionId').anyOf(sessionIds).delete()
49 await db.practice_sessions.bulkDelete(sessionIds)
50 }
51 await db.collections.delete(id)
52}

Callers

nothing calls this directly

Calls 1

deleteMethod · 0.65

Tested by

no test coverage detected