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
|
@@ -2204,49 +2204,52 @@ function uploadFilesSaga(action) {
|
|
|
2204
2204
|
blob = new Blob([file.content]);
|
|
2205
2205
|
formData = new FormData();
|
|
2206
2206
|
sanitizedPath = file.properties.path.replace(/^\/+|\/+$/g, '');
|
|
2207
|
+
console.log('sanitizedPath: ', sanitizedPath);
|
|
2207
2208
|
formData.append('file', blob, sanitizedPath || 'default_filename');
|
|
2209
|
+
console.log('formData: ', formData);
|
|
2210
|
+
console.log('file: ', file);
|
|
2208
2211
|
queryParams = pressets.length ? new URLSearchParams({
|
|
2209
2212
|
tags: pressets.join(',')
|
|
2210
2213
|
}).toString() : '';
|
|
2211
2214
|
url = queryParams ? "/upload/" + id + "?token=" + token + "&" + queryParams : "/upload/" + id + "?token=" + token;
|
|
2212
|
-
_context4.next =
|
|
2215
|
+
_context4.next = 16;
|
|
2213
2216
|
return effects.call(api.post, url, formData, {
|
|
2214
2217
|
headers: {
|
|
2215
2218
|
'Content-Type': 'multipart/form-data'
|
|
2216
2219
|
}
|
|
2217
2220
|
});
|
|
2218
|
-
case
|
|
2219
|
-
_context4.next =
|
|
2221
|
+
case 16:
|
|
2222
|
+
_context4.next = 18;
|
|
2220
2223
|
return effects.call(api.get, "/training/" + id + "?token=" + token);
|
|
2221
|
-
case
|
|
2224
|
+
case 18:
|
|
2222
2225
|
_yield$call4 = _context4.sent;
|
|
2223
2226
|
data = _yield$call4.data;
|
|
2224
|
-
_context4.next =
|
|
2227
|
+
_context4.next = 22;
|
|
2225
2228
|
return effects.put(uploadFilesActionSuccess({
|
|
2226
2229
|
files: data.files
|
|
2227
2230
|
}));
|
|
2228
|
-
case
|
|
2229
|
-
_context4.next =
|
|
2231
|
+
case 22:
|
|
2232
|
+
_context4.next = 28;
|
|
2230
2233
|
break;
|
|
2231
|
-
case
|
|
2232
|
-
_context4.prev =
|
|
2234
|
+
case 24:
|
|
2235
|
+
_context4.prev = 24;
|
|
2233
2236
|
_context4.t0 = _context4["catch"](1);
|
|
2234
2237
|
toast.error({
|
|
2235
2238
|
title: t.toast.uploadFile.fail.title,
|
|
2236
2239
|
description: t.toast.uploadFile.fail.description
|
|
2237
2240
|
});
|
|
2238
2241
|
console.log('-----------uploadFilesSaga.error------------------->', _context4.t0);
|
|
2239
|
-
case 25:
|
|
2240
|
-
_context4.prev = 25;
|
|
2241
|
-
_context4.next = 28;
|
|
2242
|
-
return effects.put(commonLoadingFinish());
|
|
2243
2242
|
case 28:
|
|
2244
|
-
|
|
2245
|
-
|
|
2243
|
+
_context4.prev = 28;
|
|
2244
|
+
_context4.next = 31;
|
|
2245
|
+
return effects.put(commonLoadingFinish());
|
|
2246
|
+
case 31:
|
|
2247
|
+
return _context4.finish(28);
|
|
2248
|
+
case 32:
|
|
2246
2249
|
case "end":
|
|
2247
2250
|
return _context4.stop();
|
|
2248
2251
|
}
|
|
2249
|
-
}, _marked4, null, [[1,
|
|
2252
|
+
}, _marked4, null, [[1, 24, 28, 32]]);
|
|
2250
2253
|
}
|
|
2251
2254
|
function TrainingSaga(action) {
|
|
2252
2255
|
var t, _action$payload5, id, pressets, token, tag, queryParams, _yield$call5, data;
|