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

Method getEntryNotes

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

* Get all notes for an entry

(collectionName: string, slug: string)

Source from the content-addressed store, hash-verified

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

Callers 1

getNotesMethod · 0.80

Calls 4

findEntryIssueMethod · 0.95
getIssueCommentsMethod · 0.95
parseCommentToNoteMethod · 0.95
mapMethod · 0.80

Tested by

no test coverage detected