File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -192,17 +192,18 @@ export function ContentType (http, data = {}) {
192192 * const data = {
193193 * content_type: 'path/to/file.json',
194194 * }
195- * client.stack({ api_key: 'api_key'}).contentType().import(data)
195+ * client.stack({ api_key: 'api_key'}).contentType().import(data, { overwrite: true } )
196196 * .then((contentType) => console.log(contentType))
197197 *
198198 */
199- this . import = async function ( data ) {
199+ this . import = async function ( data , params = { } ) {
200200 try {
201201 const response = await upload ( {
202202 http : http ,
203203 urlPath : `${ this . urlPath } /import` ,
204204 stackHeaders : this . stackHeaders ,
205- formData : createFormData ( data )
205+ formData : createFormData ( data ) ,
206+ params : params
206207 } )
207208 if ( response . data ) {
208209 return new this . constructor ( http , parseData ( response , this . stackHeaders ) )
Original file line number Diff line number Diff line change @@ -115,17 +115,18 @@ export function GlobalField (http, data = {}) {
115115 * const data = {
116116 * global_field: 'path/to/file.json',
117117 * }
118- * client.stack({ api_key: 'api_key'}).globalField().import(data)
118+ * client.stack({ api_key: 'api_key'}).globalField().import(data, { overwrite: true } )
119119 * .then((globalField) => console.log(globalField))
120120 *
121121 */
122- this . import = async function ( data ) {
122+ this . import = async function ( data , params = { } ) {
123123 try {
124124 const response = await upload ( {
125125 http : http ,
126126 urlPath : `${ this . urlPath } /import` ,
127127 stackHeaders : this . stackHeaders ,
128- formData : createFormData ( data )
128+ formData : createFormData ( data ) ,
129+ params : params
129130 } )
130131 if ( response . data ) {
131132 return new this . constructor ( http , parseData ( response , this . stackHeaders ) )
You can’t perform that action at this time.
0 commit comments