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

Function getLocalCardsForCollection

frontend/src/data/localDB/cards.ts:39–51  ·  view source on GitHub ↗
(
  collectionId: string,
  limit?: number,
)

Source from the content-addressed store, hash-verified

37}
38
39export const getLocalCardsForCollection = async (
40 collectionId: string,
41 limit?: number,
42): Promise<LocalCard[]> => {
43 if (limit && limit > 0) {
44 return await db.cards
45 .where('collectionId')
46 .equals(collectionId)
47 .limit(limit)
48 .sortBy('updatedAt')
49 }
50 return await db.cards.where('collectionId').equals(collectionId).sortBy('updatedAt')
51}
52
53export const getLocalCardById = async (id: string): Promise<LocalCard> => {
54 const card = await db.cards.get(id)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected