memorix 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -532,11 +532,14 @@ async function getObservationsByIds(ids, projectId) {
532
532
  }
533
533
  async function getTimeline(anchorId, projectId, depthBefore = 3, depthAfter = 3) {
534
534
  const database = await getDb();
535
- const allResults = await search(database, {
535
+ const searchParams = {
536
536
  term: "",
537
- where: { projectId },
538
537
  limit: 1e3
539
- });
538
+ };
539
+ if (projectId) {
540
+ searchParams.where = { projectId };
541
+ }
542
+ const allResults = await search(database, searchParams);
540
543
  const docs = allResults.hits.map((h) => h.document).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
541
544
  const anchorIndex = docs.findIndex((d) => d.observationId === anchorId);
542
545
  if (anchorIndex === -1) {