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

@ -104,12 +104,20 @@ class SharingPanelComponent extends React.Component {
share.push({ shareTo: item.id, access: 0}); share.push({ shareTo: item.id, access: 0});
} }
} }
for (let item of selectedItems) { if (!selectedItems.length) {
if (item.fileExst) { if (selectedItems.fileExst) {
fileIds.push(item.id); fileIds.push(selectedItems.id);
} else { } else {
folderIds.push(item.id); folderIds.push(selectedItems.id);
}
} else {
for (let item of selectedItems) {
if (item.fileExst) {
fileIds.push(item.id);
} else {
folderIds.push(item.id);
}
} }
} }

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 });
} }