Skip to content

Commit 6c46f47

Browse files
committed
fix(notes): align graph note lookup type
1 parent c56cb6f commit 6c46f47

3 files changed

Lines changed: 13 additions & 11 deletions

File tree

src/main/storage/providers/markdown/notes/runtime/__tests__/graph.test.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { MarkdownNote } from '../types'
1+
import type { NotesGraphNoteLookup } from '../graph'
22
import { describe, expect, it } from 'vitest'
33
import { buildNotesGraph } from '../graph'
44

@@ -11,20 +11,14 @@ function createNote(
1111
id: number,
1212
name: string,
1313
content: string,
14-
overrides: Partial<MarkdownNote> = {},
15-
): MarkdownNote {
14+
overrides: Partial<NotesGraphNoteLookup> = {},
15+
): NotesGraphNoteLookup {
1616
return {
1717
content,
18-
createdAt: 1,
19-
description: null,
20-
filePath: `${name}.md`,
2118
folderId: null,
2219
id,
23-
isDeleted: 0,
24-
isFavorites: 0,
2520
name,
2621
tags: [],
27-
updatedAt: 1,
2822
...overrides,
2923
}
3024
}

src/main/storage/providers/markdown/notes/runtime/__tests__/search.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ function createNote(id: number, name: string): MarkdownNote {
3636
isDeleted: 0,
3737
isFavorites: 0,
3838
name,
39+
properties: {},
3940
tags: [],
4041
updatedAt: now,
4142
}

src/main/storage/providers/markdown/notes/runtime/graph.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
import type { MarkdownNote } from './types'
21
import {
32
findInternalLinks,
43
resolveInternalLinkTargetByTitle,
54
} from '../../../../../../shared/notes/internalLinks'
65

6+
export interface NotesGraphNoteLookup {
7+
id: number
8+
name: string
9+
content: string
10+
folderId: number | null
11+
tags: number[]
12+
}
13+
714
export interface NotesGraphSnippetLookup {
815
id: number
916
name: string
@@ -28,7 +35,7 @@ export interface NotesGraphData {
2835
}
2936

3037
interface BuildNotesGraphInput {
31-
notes: MarkdownNote[]
38+
notes: NotesGraphNoteLookup[]
3239
snippets: NotesGraphSnippetLookup[]
3340
}
3441

0 commit comments

Comments
 (0)