(
collection: string,
slug: string,
noteData: Omit<Note, 'id'>,
entryTitle?: string,
)
| 637 | } |
| 638 | |
| 639 | async addNote( |
| 640 | collection: string, |
| 641 | slug: string, |
| 642 | noteData: Omit<Note, 'id'>, |
| 643 | entryTitle?: string, |
| 644 | ): Promise<Note> { |
| 645 | const identity = await this.noteAuthorIdentity(); |
| 646 | const note: Note = { |
| 647 | ...noteData, |
| 648 | id: `temp-${Date.now()}`, |
| 649 | author: identity.author, |
| 650 | authorId: identity.authorId, |
| 651 | isOwn: true, |
| 652 | entrySlug: slug, |
| 653 | timestamp: noteData.timestamp || new Date().toISOString(), |
| 654 | resolved: noteData.resolved || false, |
| 655 | }; |
| 656 | |
| 657 | const { commentId, issueUrl } = await this.notesApi!.addNoteToEntry( |
| 658 | collection, |
| 659 | slug, |
| 660 | note, |
| 661 | entryTitle, |
| 662 | ); |
| 663 | |
| 664 | return { ...note, id: commentId, issueUrl }; |
| 665 | } |
| 666 | |
| 667 | private async findNote(collection: string, slug: string, noteId: string) { |
| 668 | const notes = await this.notesApi!.getEntryNotes(collection, slug); |
nothing calls this directly
no test coverage detected