Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

feat: add attachments lookup

thecodrr70fee1894a82
diff --git a/packages/core/api/lookup.js b/packages/core/api/lookup.js
index 1611c4b56..b0aacf977 100644
--- a/packages/core/api/lookup.js
+++ b/packages/core/api/lookup.js
@@ -42,6 +42,14 @@ export default class Lookup {
return this._byTitle(array, query);
}
+ attachments(array, query) {
+ return search(
+ array,
+ query,
+ (n) => `${n.metadata.filename} ${n.metadata.type} ${n.metadata.hash}`
+ );
+ }
+
_byTitle(array, query) {
return search(array, query, (n) => n.title);
}