mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-26 15:26:19 +00:00
sys admin update org status on search result page (#8177)
Co-authored-by: lian <imwhatiam123@gmail.com>
This commit is contained in:
@@ -42,6 +42,24 @@ class SearchOrgs extends Component {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
updateStatus = (orgID, isActive) => {
|
||||||
|
let orgInfo = {};
|
||||||
|
orgInfo.isActive = isActive;
|
||||||
|
systemAdminAPI.sysAdminUpdateOrg(orgID, orgInfo).then(res => {
|
||||||
|
let newOrgList = this.state.orgList.map(org => {
|
||||||
|
if (org.org_id == orgID) {
|
||||||
|
org.is_active = isActive;
|
||||||
|
}
|
||||||
|
return org;
|
||||||
|
});
|
||||||
|
this.setState({ orgList: newOrgList });
|
||||||
|
toaster.success(gettext('Edit succeeded'));
|
||||||
|
}).catch((error) => {
|
||||||
|
let errMessage = Utils.getErrorMsg(error);
|
||||||
|
toaster.danger(errMessage);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
updateRole = (orgID, role) => {
|
updateRole = (orgID, role) => {
|
||||||
let orgInfo = {};
|
let orgInfo = {};
|
||||||
orgInfo.role = role;
|
orgInfo.role = role;
|
||||||
@@ -129,6 +147,7 @@ class SearchOrgs extends Component {
|
|||||||
loading={this.state.loading}
|
loading={this.state.loading}
|
||||||
errorMsg={this.state.errorMsg}
|
errorMsg={this.state.errorMsg}
|
||||||
items={this.state.orgList}
|
items={this.state.orgList}
|
||||||
|
updateStatus={this.updateStatus}
|
||||||
updateRole={this.updateRole}
|
updateRole={this.updateRole}
|
||||||
deleteOrg={this.deleteOrg}
|
deleteOrg={this.deleteOrg}
|
||||||
/>
|
/>
|
||||||
|
Reference in New Issue
Block a user