* Create a GitHub issue for storing notes for a specific entry
(
collectionName: string,
slug: string,
entryTitle?: string,
)
| 1605 | * Create a GitHub issue for storing notes for a specific entry |
| 1606 | */ |
| 1607 | async createEntryIssue( |
| 1608 | collectionName: string, |
| 1609 | slug: string, |
| 1610 | entryTitle?: string, |
| 1611 | ): Promise<GitHubIssue> { |
| 1612 | const title = `${API.NOTE_ISSUE_PREFIX}${entryTitle || `${collectionName}/${slug}`}`; |
| 1613 | const body = `This issue tracks notes for entry: \`${collectionName}/${slug}\`\n\n---\n*This issue was created automatically by Decap CMS for note management.*`; |
| 1614 | |
| 1615 | const response: GitHubIssue = await this.request(`${this.repoURL}/issues`, { |
| 1616 | method: 'POST', |
| 1617 | body: JSON.stringify({ |
| 1618 | title, |
| 1619 | body, |
| 1620 | labels: [API.NOTES_LABEL, `collection:${collectionName}`], |
| 1621 | }), |
| 1622 | }); |
| 1623 | |
| 1624 | return response; |
| 1625 | } |
| 1626 | |
| 1627 | /** |
| 1628 | * Find existing issue for an entry (returns null if not found) |