MCPcopy Create free account
hub / github.com/decaporg/decap-cms / addNoteToEntry

Method addNoteToEntry

packages/decap-cms-backend-github/src/API.ts:1883–1903  ·  view source on GitHub ↗

* Add a note to any entry

(
    collectionName: string,
    slug: string,
    note: Note,
    entryTitle?: string,
  )

Source from the content-addressed store, hash-verified

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 {

Callers 1

addNoteMethod · 0.80

Calls 3

findEntryIssueMethod · 0.95
createEntryIssueMethod · 0.95
createIssueCommentMethod · 0.95

Tested by

no test coverage detected