code7-leia 0.2.5 → 0.2.8

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.
@@ -2191,7 +2191,7 @@ function testSaga(action) {
2191
2191
  }, _marked3, null, [[0, 12, 15, 19]]);
2192
2192
  }
2193
2193
  function uploadFilesSaga(action) {
2194
- var t, _action$payload4, id, file, pressets, token, tags, blob, formData, queryParams, _yield$call4, data;
2194
+ var t, _action$payload4, id, file, pressets, token, blob, formData, queryParams, url, _yield$call4, data;
2195
2195
  return _regeneratorRuntime().wrap(function uploadFilesSaga$(_context4) {
2196
2196
  while (1) switch (_context4.prev = _context4.next) {
2197
2197
  case 0:
@@ -2201,15 +2201,15 @@ function uploadFilesSaga(action) {
2201
2201
  return effects.put(commonLoadingStart());
2202
2202
  case 4:
2203
2203
  _action$payload4 = action.payload, id = _action$payload4.id, file = _action$payload4.file, pressets = _action$payload4.pressets, token = _action$payload4.token;
2204
- tags = pressets.join(',');
2205
2204
  blob = new Blob([file.content]);
2206
2205
  formData = new FormData();
2207
2206
  formData.append('file', blob, file.properties.path);
2208
- queryParams = new URLSearchParams({
2209
- tags: tags
2210
- }).toString();
2207
+ queryParams = pressets.length ? new URLSearchParams({
2208
+ tags: pressets.join(',')
2209
+ }).toString() : '';
2210
+ url = queryParams ? "/upload/" + id + "?token=" + token + "&" + queryParams : "/upload/" + id + "?token=" + token;
2211
2211
  _context4.next = 12;
2212
- return effects.call(api.post, "/upload/" + id + "?token=" + token + "&" + queryParams, formData, {
2212
+ return effects.call(api.post, url, formData, {
2213
2213
  headers: {
2214
2214
  'Content-Type': 'multipart/form-data'
2215
2215
  }
@@ -2263,8 +2263,9 @@ function TrainingSaga(action) {
2263
2263
  tag: tag
2264
2264
  }).toString();
2265
2265
  _context5.next = 9;
2266
- return effects.call(api.post, pressets.length > 0 ? "/training?token=" + token + "&" + queryParams : "/training?token=" + token, {
2267
- files_directory: id
2266
+ return effects.call(api.post, pressets.length > 0 ? "/training?" + queryParams : "/training", {
2267
+ files_directory: id,
2268
+ token: token
2268
2269
  });
2269
2270
  case 9:
2270
2271
  _context5.next = 11;