File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ export type HistoryItem = {
4848 tags : string [ ]
4949}
5050
51+ export type NewNoteOption = {
52+ team : string
53+ }
54+
5155/**
5256 * codimd API Client
5357 */
@@ -121,10 +125,17 @@ class API {
121125 return response . json ( )
122126 }
123127
124- async newNote ( body : string ) {
128+ async newNote ( body : string , options ?: NewNoteOption ) {
125129 let response
126130 if ( this . enterprise ) {
127- response = await this . fetch ( `${ this . serverUrl } /new` , {
131+ let newNoteUrl
132+ if ( options ?. team ) {
133+ newNoteUrl = `${ this . serverUrl } /team/${ options . team } /new`
134+ } else {
135+ newNoteUrl = `${ this . serverUrl } /new`
136+ }
137+
138+ response = await this . fetch ( newNoteUrl , {
128139 method : 'POST' ,
129140 body : encodeFormComponent ( { content : body } ) ,
130141 headers : await this . wrapHeaders ( {
You can’t perform that action at this time.
0 commit comments