mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-04 16:31:13 +00:00
fix bug when share group owned repo to group (#5686)
This commit is contained in:
@@ -195,17 +195,13 @@ class ShareToGroup extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
shareToGroup = () => {
|
shareToGroup = () => {
|
||||||
let groups = [];
|
|
||||||
let path = this.props.itemPath;
|
let path = this.props.itemPath;
|
||||||
let repoID = this.props.repoID;
|
let repoID = this.props.repoID;
|
||||||
let isGroupOwnedRepo = this.props.isGroupOwnedRepo;
|
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) {
|
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 = [];
|
let errorMsg = [];
|
||||||
if (res.data.failed.length > 0) {
|
if (res.data.failed.length > 0) {
|
||||||
for (let i = 0 ; i < res.data.failed.length ; i++) {
|
for (let i = 0 ; i < res.data.failed.length ; i++) {
|
||||||
@@ -234,7 +230,7 @@ class ShareToGroup extends React.Component {
|
|||||||
toaster.danger(errMessage);
|
toaster.danger(errMessage);
|
||||||
});
|
});
|
||||||
} else {
|
} 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 = [];
|
let errorMsg = [];
|
||||||
if (res.data.failed.length > 0) {
|
if (res.data.failed.length > 0) {
|
||||||
for (let i = 0 ; i < res.data.failed.length ; i++) {
|
for (let i = 0 ; i < res.data.failed.length ; i++) {
|
||||||
|
Reference in New Issue
Block a user