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

Method getEntryNotes

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

* Get all notes for an entry

(collectionName: string, slug: string)

Source from the content-addressed store, hash-verified

1856 * Get all notes for an entry
1857 */
1858 async getEntryNotes(collectionName: string, slug: string): Promise<Note[]> {
1859 try {
1860 const issue = await this.findEntryIssue(collectionName, slug);
1861 if (!issue) {
1862 return []; // No issue means no notes yet
1863 }
1864 const comments = await this.getIssueComments(issue.number);
1865 const issueUrl = issue.html_url; // Get the issue URL once
1866
1867 // Add issueUrl to each note (this info is picked up by the UI to direct users to the source of the Notes in Github)
1868 return commentsToNotes(comments, issueUrl, comment => this.parseCommentToNote(comment));
1869 } catch (error) {
1870 console.error('Failed to get entry notes:', error);
1871 return [];
1872 }
1873 }
1874
1875 /**
1876 * Add a note to any entry

Callers 2

getNotesMethod · 0.45
API.spec.jsFile · 0.45

Calls 4

findEntryIssueMethod · 0.95
getIssueCommentsMethod · 0.95
parseCommentToNoteMethod · 0.95
commentsToNotesFunction · 0.90

Tested by

no test coverage detected