1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-24 21:07:17 +00:00

sys admin update org status on search result page (#8177)

Co-authored-by: lian <imwhatiam123@gmail.com>
This commit is contained in:
Michael An
2025-08-28 17:22:55 +08:00
committed by GitHub
parent 0385ba06db
commit 175141cc12

View File

@@ -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) => {
let orgInfo = {};
orgInfo.role = role;
@@ -129,6 +147,7 @@ class SearchOrgs extends Component {
loading={this.state.loading}
errorMsg={this.state.errorMsg}
items={this.state.orgList}
updateStatus={this.updateStatus}
updateRole={this.updateRole}
deleteOrg={this.deleteOrg}
/>