code7-leia 0.2.6 → 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.
@@ -2183,7 +2183,7 @@ function testSaga(action) {
2183
2183
  }, _marked3, null, [[0, 12, 15, 19]]);
2184
2184
  }
2185
2185
  function uploadFilesSaga(action) {
2186
- var t, _action$payload4, id, file, pressets, token, tags, blob, formData, queryParams, _yield$call4, data;
2186
+ var t, _action$payload4, id, file, pressets, token, blob, formData, queryParams, url, _yield$call4, data;
2187
2187
  return _regeneratorRuntime().wrap(function uploadFilesSaga$(_context4) {
2188
2188
  while (1) switch (_context4.prev = _context4.next) {
2189
2189
  case 0:
@@ -2193,15 +2193,15 @@ function uploadFilesSaga(action) {
2193
2193
  return put(commonLoadingStart());
2194
2194
  case 4:
2195
2195
  _action$payload4 = action.payload, id = _action$payload4.id, file = _action$payload4.file, pressets = _action$payload4.pressets, token = _action$payload4.token;
2196
- tags = pressets.join(',');
2197
2196
  blob = new Blob([file.content]);
2198
2197
  formData = new FormData();
2199
2198
  formData.append('file', blob, file.properties.path);
2200
- queryParams = new URLSearchParams({
2201
- tags: tags
2202
- }).toString();
2199
+ queryParams = pressets.length ? new URLSearchParams({
2200
+ tags: pressets.join(',')
2201
+ }).toString() : '';
2202
+ url = queryParams ? "/upload/" + id + "?token=" + token + "&" + queryParams : "/upload/" + id + "?token=" + token;
2203
2203
  _context4.next = 12;
2204
- return call(api.post, "/upload/" + id + "?token=" + token + "&" + queryParams, formData, {
2204
+ return call(api.post, url, formData, {
2205
2205
  headers: {
2206
2206
  'Content-Type': 'multipart/form-data'
2207
2207
  }