1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 08:28:11 +00:00

fix bug when share group owned repo to group (#5686)

This commit is contained in:
lian
2023-10-13 15:47:08 +08:00
committed by GitHub
parent b907d21f08
commit cd2ff4aa9d

View File

@@ -195,17 +195,13 @@ class ShareToGroup extends React.Component {
};
shareToGroup = () => {
let groups = [];
let path = this.props.itemPath;
let repoID = this.props.repoID;
let isGroupOwnedRepo = this.props.isGroupOwnedRepo;
if (this.state.selectedOption && this.state.selectedOption.length > 0 ) {
for (let i = 0; i < this.state.selectedOption.length; i ++) {
groups[i] = this.state.selectedOption[i].id;
}
}
if (isGroupOwnedRepo) {
seafileAPI.shareGroupOwnedRepoToGroup(repoID, this.state.permission, groups, path).then(res => {
seafileAPI.shareGroupOwnedRepoToGroup(repoID, this.state.permission, this.state.selectedOption['id'], path).then(res => {
let errorMsg = [];
if (res.data.failed.length > 0) {
for (let i = 0 ; i < res.data.failed.length ; i++) {
@@ -234,7 +230,7 @@ class ShareToGroup extends React.Component {
toaster.danger(errMessage);
});
} else {
seafileAPI.shareFolder(repoID, path, 'group', this.state.permission, groups).then(res => {
seafileAPI.shareFolder(repoID, path, 'group', this.state.permission, [this.state.selectedOption['id']]).then(res => {
let errorMsg = [];
if (res.data.failed.length > 0) {
for (let i = 0 ; i < res.data.failed.length ; i++) {