* Add a note to any entry
(
collectionName: string,
slug: string,
note: Note,
entryTitle?: string,
)
| 1876 | * Add a note to any entry |
| 1877 | */ |
| 1878 | async addNoteToEntry( |
| 1879 | collectionName: string, |
| 1880 | slug: string, |
| 1881 | note: Note, |
| 1882 | entryTitle?: string, |
| 1883 | ): Promise<{ commentId: string; issueUrl: string }> { |
| 1884 | try { |
| 1885 | let issue = await this.findEntryIssue(collectionName, slug); |
| 1886 | if (!issue) { |
| 1887 | issue = await this.createEntryIssue(collectionName, slug, entryTitle); |
| 1888 | } |
| 1889 | const commentId = await this.createIssueComment(issue.number, note); |
| 1890 | return { |
| 1891 | commentId, |
| 1892 | issueUrl: issue.html_url, |
| 1893 | }; |
| 1894 | } catch (error) { |
| 1895 | console.error('Failed to add note to entry:', error); |
| 1896 | throw new APIError('Failed to create note', error.status || 500, API_NAME); |
| 1897 | } |
| 1898 | } |
| 1899 | |
| 1900 | async updateEntryNote(noteId: string, note: Note): Promise<void> { |
| 1901 | try { |
no test coverage detected