MCPcopy Create free account
hub / github.com/AlexErrant/Pentive / getNotesByIds

Function getNotesByIds

app/src/sqlite/note.ts:236–256  ·  view source on GitHub ↗
(noteIds: NoteId[])

Source from the content-addressed store, hash-verified

234 return note == null ? null : noteEntityToDomain(note, remoteNotes)
235 },
236 async getNotesByIds(noteIds: NoteId[]) {
237 const noteDbIds = noteIds.map(toLDbId)
238 const remoteNotes = await ky
239 .selectFrom('remoteNote')
240 .selectAll()
241 .where('localId', 'in', noteDbIds)
242 .execute()
243 const notes = await ky
244 .selectFrom('note')
245 .selectAll('note')
246 .innerJoin('template', 'note.templateId', 'template.id')
247 .select('template.fields as template_fields')
248 .where('note.id', 'in', noteDbIds)
249 .execute()
250 return notes.map((ln) =>
251 noteEntityToDomain(
252 ln,
253 remoteNotes.filter((rn) => rn.localId === ln.id),
254 ),
255 )
256 },
257 async getNewNotesToUpload(noteId?: NoteId, nook?: NookId) {
258 const remoteTemplates = await ky
259 .selectFrom('remoteTemplate')

Callers

nothing calls this directly

Calls 1

noteEntityToDomainFunction · 0.90

Tested by

no test coverage detected