* Get all entries that have notes (useful for showing notes indicator in UI)
()
| 1919 | * Get all entries that have notes (useful for showing notes indicator in UI) |
| 1920 | */ |
| 1921 | async getEntriesWithNotes(): Promise< |
| 1922 | Array<{ collection: string; slug: string; noteCount: number }> |
| 1923 | > { |
| 1924 | try { |
| 1925 | const issues = await this.listNotesIssues('open'); |
| 1926 | |
| 1927 | const entriesWithNotes = []; |
| 1928 | |
| 1929 | for (const issue of issues) { |
| 1930 | // Extract collection/slug from issue body |
| 1931 | const match = issue.body.match(/entry: `(.+)\/(.+)`/); |
| 1932 | if (match) { |
| 1933 | const [, collection, slug] = match; |
| 1934 | entriesWithNotes.push({ |
| 1935 | collection, |
| 1936 | slug, |
| 1937 | noteCount: issue.comments, |
| 1938 | }); |
| 1939 | } |
| 1940 | } |
| 1941 | |
| 1942 | return entriesWithNotes; |
| 1943 | } catch (error) { |
| 1944 | console.error('Failed to get entries with notes:', error); |
| 1945 | return []; |
| 1946 | } |
| 1947 | } |
| 1948 | |
| 1949 | /** |
| 1950 | * Close notes issue when entry is deleted |
no test coverage detected