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 = {
48
48
tags : string [ ]
49
49
}
50
50
51
+ export type NewNoteOption = {
52
+ team : string
53
+ }
54
+
51
55
/**
52
56
* codimd API Client
53
57
*/
@@ -121,10 +125,17 @@ class API {
121
125
return response . json ( )
122
126
}
123
127
124
- async newNote ( body : string ) {
128
+ async newNote ( body : string , options ?: NewNoteOption ) {
125
129
let response
126
130
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 , {
128
139
method : 'POST' ,
129
140
body : encodeFormComponent ( { content : body } ) ,
130
141
headers : await this . wrapHeaders ( {
You can’t perform that action at this time.
0 commit comments