code7-leia 0.2.16 → 0.2.17
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/dist/code7-leia.cjs.development.js +19 -16
- package/dist/code7-leia.cjs.development.js.map +1 -1
- package/dist/code7-leia.cjs.production.min.js +1 -1
- package/dist/code7-leia.cjs.production.min.js.map +1 -1
- package/dist/code7-leia.esm.js +19 -16
- package/dist/code7-leia.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/store/modules/sagas.ts +3 -0
package/dist/code7-leia.esm.js
CHANGED
|
@@ -2196,49 +2196,52 @@ function uploadFilesSaga(action) {
|
|
|
2196
2196
|
blob = new Blob([file.content]);
|
|
2197
2197
|
formData = new FormData();
|
|
2198
2198
|
sanitizedPath = file.properties.path.replace(/^\/+|\/+$/g, '');
|
|
2199
|
+
console.log('sanitizedPath: ', sanitizedPath);
|
|
2199
2200
|
formData.append('file', blob, sanitizedPath || 'default_filename');
|
|
2201
|
+
console.log('formData: ', formData);
|
|
2202
|
+
console.log('file: ', file);
|
|
2200
2203
|
queryParams = pressets.length ? new URLSearchParams({
|
|
2201
2204
|
tags: pressets.join(',')
|
|
2202
2205
|
}).toString() : '';
|
|
2203
2206
|
url = queryParams ? "/upload/" + id + "?token=" + token + "&" + queryParams : "/upload/" + id + "?token=" + token;
|
|
2204
|
-
_context4.next =
|
|
2207
|
+
_context4.next = 16;
|
|
2205
2208
|
return call(api.post, url, formData, {
|
|
2206
2209
|
headers: {
|
|
2207
2210
|
'Content-Type': 'multipart/form-data'
|
|
2208
2211
|
}
|
|
2209
2212
|
});
|
|
2210
|
-
case
|
|
2211
|
-
_context4.next =
|
|
2213
|
+
case 16:
|
|
2214
|
+
_context4.next = 18;
|
|
2212
2215
|
return call(api.get, "/training/" + id + "?token=" + token);
|
|
2213
|
-
case
|
|
2216
|
+
case 18:
|
|
2214
2217
|
_yield$call4 = _context4.sent;
|
|
2215
2218
|
data = _yield$call4.data;
|
|
2216
|
-
_context4.next =
|
|
2219
|
+
_context4.next = 22;
|
|
2217
2220
|
return put(uploadFilesActionSuccess({
|
|
2218
2221
|
files: data.files
|
|
2219
2222
|
}));
|
|
2220
|
-
case
|
|
2221
|
-
_context4.next =
|
|
2223
|
+
case 22:
|
|
2224
|
+
_context4.next = 28;
|
|
2222
2225
|
break;
|
|
2223
|
-
case
|
|
2224
|
-
_context4.prev =
|
|
2226
|
+
case 24:
|
|
2227
|
+
_context4.prev = 24;
|
|
2225
2228
|
_context4.t0 = _context4["catch"](1);
|
|
2226
2229
|
toast.error({
|
|
2227
2230
|
title: t.toast.uploadFile.fail.title,
|
|
2228
2231
|
description: t.toast.uploadFile.fail.description
|
|
2229
2232
|
});
|
|
2230
2233
|
console.log('-----------uploadFilesSaga.error------------------->', _context4.t0);
|
|
2231
|
-
case 25:
|
|
2232
|
-
_context4.prev = 25;
|
|
2233
|
-
_context4.next = 28;
|
|
2234
|
-
return put(commonLoadingFinish());
|
|
2235
2234
|
case 28:
|
|
2236
|
-
|
|
2237
|
-
|
|
2235
|
+
_context4.prev = 28;
|
|
2236
|
+
_context4.next = 31;
|
|
2237
|
+
return put(commonLoadingFinish());
|
|
2238
|
+
case 31:
|
|
2239
|
+
return _context4.finish(28);
|
|
2240
|
+
case 32:
|
|
2238
2241
|
case "end":
|
|
2239
2242
|
return _context4.stop();
|
|
2240
2243
|
}
|
|
2241
|
-
}, _marked4, null, [[1,
|
|
2244
|
+
}, _marked4, null, [[1, 24, 28, 32]]);
|
|
2242
2245
|
}
|
|
2243
2246
|
function TrainingSaga(action) {
|
|
2244
2247
|
var t, _action$payload5, id, pressets, token, tag, queryParams, _yield$call5, data;
|