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

Function updateLocalCard

frontend/src/data/localDB/cards.ts:59–75  ·  view source on GitHub ↗
(
  id: string,
  updates: Partial<Pick<LocalCard, 'front' | 'back'>>,
)

Source from the content-addressed store, hash-verified

57}
58
59export const updateLocalCard = async (
60 id: string,
61 updates: Partial<Pick<LocalCard, 'front' | 'back'>>,
62): Promise<number> => {
63 const card = await db.cards.get(id)
64 if (!card) throw new Error('Card not found for update')
65 const result = await db.cards.update(id, {
66 ...updates,
67 updatedAt: Date.now(),
68 synced: false,
69 })
70 await db.collections.update(card.collectionId, {
71 updatedAt: Date.now(),
72 synced: false,
73 })
74 return result
75}
76
77export const deleteLocalCard = async (id: string): Promise<void> => {
78 const card = await db.cards.get(id)

Callers

nothing calls this directly

Calls 1

updateMethod · 0.65

Tested by

no test coverage detected