mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-29 00:20:04 +01:00
web: fix tags not showing in locked note (#7061)
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -197,6 +197,15 @@ test("update note", () =>
|
||||
expect(note?.favorite).toBe(true);
|
||||
}));
|
||||
|
||||
test("get note tags", () =>
|
||||
noteTest({
|
||||
...TEST_NOTE
|
||||
}).then(async ({ db, id }) => {
|
||||
const tag = await db.tags.add({ title: "hello" });
|
||||
await db.relations.add({ type: "tag", id: tag }, { type: "note", id });
|
||||
expect(await db.notes.tags(id)).toEqual([await db.tags.tag(tag)]);
|
||||
}));
|
||||
|
||||
test("get favorite notes", () =>
|
||||
noteTest({
|
||||
...TEST_NOTE,
|
||||
|
||||
@@ -176,6 +176,15 @@ export class Notes implements ICollection {
|
||||
return note;
|
||||
}
|
||||
|
||||
async tags(id: string) {
|
||||
return this.db.relations
|
||||
.to({ id, type: "note" }, "tag")
|
||||
.selector.items(undefined, {
|
||||
sortBy: "dateCreated",
|
||||
sortDirection: "asc"
|
||||
});
|
||||
}
|
||||
|
||||
// note(idOrNote: string | Note) {
|
||||
// if (!idOrNote) return;
|
||||
// const note =
|
||||
|
||||
Reference in New Issue
Block a user