@andersonalmeidax0/webcomponents 0.1.19 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RestAPIAdapter.js +7 -6
- package/package.json +1 -1
package/RestAPIAdapter.js
CHANGED
|
@@ -136,7 +136,7 @@ X-Colocar o MetalMarlek em outro server AWS ... com docker... com outra conta de
|
|
|
136
136
|
|
|
137
137
|
var {method,url,body}=this.getParams(q,vo,this.tableName,filter);
|
|
138
138
|
//server is optional
|
|
139
|
-
url = this.urlServer==null?url:this.urlServer+url;
|
|
139
|
+
url = (this.urlServer==null)?url:this.urlServer+url;
|
|
140
140
|
|
|
141
141
|
const response = await this.myFetch3(ptoken,url,method,body);
|
|
142
142
|
if (!response.ok) {
|
|
@@ -152,7 +152,7 @@ X-Colocar o MetalMarlek em outro server AWS ... com docker... com outra conta de
|
|
|
152
152
|
|
|
153
153
|
//tag de dados pode ser nada,result, data
|
|
154
154
|
if(this.tagData==null){
|
|
155
|
-
if(vo.filedata)
|
|
155
|
+
if(vo&&vo.filedata)
|
|
156
156
|
await this.uploadFile(vo.filedata);
|
|
157
157
|
return r;
|
|
158
158
|
|
|
@@ -162,7 +162,7 @@ X-Colocar o MetalMarlek em outro server AWS ... com docker... com outra conta de
|
|
|
162
162
|
if(r[respBlock])
|
|
163
163
|
r[respBlock].insertedId=r.insertedId;
|
|
164
164
|
if(r[respBlock]) {
|
|
165
|
-
if(vo.filedata)
|
|
165
|
+
if(vo&&vo.filedata)
|
|
166
166
|
await this.uploadFile(vo.filedata);
|
|
167
167
|
return r[respBlock];
|
|
168
168
|
}
|
|
@@ -176,10 +176,10 @@ X-Colocar o MetalMarlek em outro server AWS ... com docker... com outra conta de
|
|
|
176
176
|
*
|
|
177
177
|
*********************** */
|
|
178
178
|
async uploadFile(fileData) {
|
|
179
|
-
alert('UPLOAD start');
|
|
179
|
+
alert('UPLOAD start:'+this.urlServer+'/upload');
|
|
180
180
|
let formData = new FormData();
|
|
181
181
|
formData.append('file', fileData);
|
|
182
|
-
const response = await fetch(
|
|
182
|
+
const response = await fetch(this.urlServer+'/upload', {
|
|
183
183
|
method: 'POST',
|
|
184
184
|
body: formData,
|
|
185
185
|
})
|
|
@@ -199,7 +199,8 @@ X-Colocar o MetalMarlek em outro server AWS ... com docker... com outra conta de
|
|
|
199
199
|
|
|
200
200
|
|
|
201
201
|
async download(fname) {
|
|
202
|
-
|
|
202
|
+
alert('UPLOAD start:'+this.urlServer+'/download/'+fname);
|
|
203
|
+
var response=await fetch(this.urlServer+'/download/'+fname, {
|
|
203
204
|
method: 'GET'
|
|
204
205
|
})
|
|
205
206
|
if (!response.ok) {
|