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