Web: Files: fixed sharing panel selected options

This commit is contained in:
Nikita Gopienko 2020-05-18 11:34:07 +03:00
parent bcd8e1915e
commit 4b89f35538
2 changed files with 13 additions and 6 deletions

View File

@ -105,6 +105,13 @@ class SharingPanelComponent extends React.Component {
} }
} }
if (!selectedItems.length) {
if (selectedItems.fileExst) {
fileIds.push(selectedItems.id);
} else {
folderIds.push(selectedItems.id);
}
} else {
for (let item of selectedItems) { for (let item of selectedItems) {
if (item.fileExst) { if (item.fileExst) {
fileIds.push(item.id); fileIds.push(item.id);
@ -112,6 +119,7 @@ class SharingPanelComponent extends React.Component {
folderIds.push(item.id); folderIds.push(item.id);
} }
} }
}
setShareFiles(folderIds, fileIds, share, isNotifyUsers, message) setShareFiles(folderIds, fileIds, share, isNotifyUsers, message)
.catch((err) => toastr.error(err)) .catch((err) => toastr.error(err))

View File

@ -310,7 +310,6 @@ export function setShareFolder(folderId, share, notify, sharingMessage) {
export function setShareFiles(fileId, share, notify, sharingMessage) { export function setShareFiles(fileId, share, notify, sharingMessage) {
const data = { share, notify, sharingMessage }; const data = { share, notify, sharingMessage };
console.log("data", data);
return request({ method: "put", url: `/files/file/${fileId}/share`, data }); return request({ method: "put", url: `/files/file/${fileId}/share`, data });
} }