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

Method addNote

packages/decap-cms-backend-gitlab/src/implementation.ts:639–665  ·  view source on GitHub ↗
(
    collection: string,
    slug: string,
    noteData: Omit<Note, 'id'>,
    entryTitle?: string,
  )

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 2

noteAuthorIdentityMethod · 0.95
addNoteToEntryMethod · 0.45

Tested by

no test coverage detected