code7-leia 0.2.6 → 0.2.7

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.
@@ -1542,7 +1542,7 @@ var FileArea = function FileArea() {
1542
1542
  setModal(!modal);
1543
1543
  };
1544
1544
  var handleOpenModalDelete = function handleOpenModalDelete(name) {
1545
- setFileDelete(name + '.pdf');
1545
+ setFileDelete(name);
1546
1546
  setModalDelete(!modalDelete);
1547
1547
  };
1548
1548
  var handleOpenModalTraining = function handleOpenModalTraining(tags) {
@@ -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
  }