From b46ebe9dabbcfe6c8d012e71acd81d5ac9d7f5a0 Mon Sep 17 00:00:00 2001 From: Du Peng Date: Thu, 12 May 2022 11:11:50 +0200 Subject: [PATCH] fix bug: admin can't show his group --- app/frontend/src/javascript/components/group/change-group.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/frontend/src/javascript/components/group/change-group.tsx b/app/frontend/src/javascript/components/group/change-group.tsx index 8e0a49364..21e5b74d6 100644 --- a/app/frontend/src/javascript/components/group/change-group.tsx +++ b/app/frontend/src/javascript/components/group/change-group.tsx @@ -41,7 +41,7 @@ export const ChangeGroup: React.FC = ({ user, onSuccess, onErr const { handleSubmit, control } = useForm(); useEffect(() => { - GroupAPI.index({ disabled: false, admins: false }).then(setGroups).catch(onError); + GroupAPI.index({ disabled: false, admins: user?.role === 'admin' }).then(setGroups).catch(onError); MemberAPI.current().then(setOperator).catch(onError); SettingAPI.get(SettingName.UserChangeGroup).then((setting) => { setAllowedUserChangeGoup(setting.value === 'true');