( collectionId: string, limit?: number, )
| 37 | } |
| 38 | |
| 39 | export 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 | |
| 53 | export const getLocalCardById = async (id: string): Promise<LocalCard> => { |
| 54 | const card = await db.cards.get(id) |
nothing calls this directly
no outgoing calls
no test coverage detected