@@ -4,14 +4,15 @@ import {Flags} from '@oclif/core'
44
55import HackMDCommand from '../../command'
66import {
7- noteContent , noteId , notePermission , noteTags , parentFolderId , permalink , teamPath ,
7+ noteContent , noteId , notePermission , noteTags , noteTitle , parentFolderId , permalink , teamPath ,
88} from '../../flags'
99import { buildNoteUpdatePayload } from '../../note-update'
1010import { safeStdinRead } from '../../utils'
1111
1212export default class Update extends HackMDCommand {
1313 static description = 'Update team note'
1414 static examples = [
15+ "$ hackmd-cli team-notes update --teamPath=CLI-test --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --title='A new title'" ,
1516 "$ hackmd-cli team-notes update --teamPath=CLI-test --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --content='# A new title'" ,
1617 "$ hackmd-cli team-notes update --teamPath=CLI-test --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --parentFolderId=fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c --content='# A new title'" ,
1718 '$ hackmd-cli team-notes update --teamPath=CLI-test --noteId=WNkLM6gkS0Cg2cQ8rv7bYA --readPermission=owner --writePermission=owner' ,
@@ -27,12 +28,13 @@ export default class Update extends HackMDCommand {
2728 readPermission : notePermission ( ) ,
2829 tags : noteTags ,
2930 teamPath,
31+ title : noteTitle ,
3032 writePermission : notePermission ( ) ,
3133 }
3234
3335 async run ( ) {
3436 const { flags} = await this . parse ( Update )
35- const { content, noteId, parentFolderId, permalink, readPermission, tags, teamPath, writePermission} = flags
37+ const { content, noteId, parentFolderId, permalink, readPermission, tags, teamPath, title , writePermission} = flags
3638
3739 if ( ! teamPath ) {
3840 this . error ( 'Flag teamPath could not be empty' )
@@ -47,7 +49,7 @@ export default class Update extends HackMDCommand {
4749 try {
4850 payload = buildNoteUpdatePayload (
4951 {
50- content, parentFolderId, permalink, readPermission, tags, writePermission,
52+ content, parentFolderId, permalink, readPermission, tags, title , writePermission,
5153 } ,
5254 stdinContent ,
5355 )
0 commit comments