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

Method addNoteToEntry

packages/decap-cms-backend-github/src/API.ts:1878–1898  ·  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

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 {

Callers 1

addNoteMethod · 0.45

Calls 3

findEntryIssueMethod · 0.95
createEntryIssueMethod · 0.95
createIssueCommentMethod · 0.95

Tested by

no test coverage detected