瀏覽代碼

Use injectServerConfigurations

Shun Miyazawa 3 年之前
父節點
當前提交
03afaa7e79
共有 1 個文件被更改,包括 6 次插入5 次删除
  1. 6 5
      packages/app/src/pages/admin/user-group-detail/[userGroupId].page.tsx

+ 6 - 5
packages/app/src/pages/admin/user-group-detail/[userGroupId].page.tsx

@@ -42,14 +42,15 @@ const AdminUserGroupDetailPage: NextPage<Props> = (props: Props) => {
   );
 };
 
-export const getServerSideProps: GetServerSideProps = async(context: GetServerSidePropsContext) => {
-  const props = await retrieveServerSideProps(context);
+const injectServerConfigurations = async(context: GetServerSidePropsContext, props: Props): Promise<void> => {
+  const req: CrowiRequest = context.req as CrowiRequest;
+  props.isAclEnabled = req.crowi.aclService.isAclEnabled();
+};
 
-  const req = context.req as CrowiRequest;
-  props.props.isAclEnabled = req.crowi.aclService.isAclEnabled();
+export const getServerSideProps: GetServerSideProps = async(context: GetServerSidePropsContext) => {
+  const props = await retrieveServerSideProps(context, injectServerConfigurations);
 
   return props;
 };
 
-
 export default AdminUserGroupDetailPage;