fix: add useAdminSchemaUid (#2092)

Co-authored-by: chenos <chenlinxh@gmail.com>
This commit is contained in:
jack zhang 2023-06-21 16:40:21 +08:00 committed by GitHub
parent daa48302df
commit d7ed43b86d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 6 deletions

View File

@ -1,7 +1,7 @@
import { Spin } from 'antd';
import React, { createContext, useContext } from 'react';
import { useRequest } from '../../api-client';
import { useSystemSettings } from '../../system-settings';
import { useAdminSchemaUid } from '../../hooks';
const MenuItemsContext = createContext(null);

View File

@ -1 +1,2 @@
export * from './useAdminSchemaUid';
export * from './useViewport';

View File

@ -0,0 +1,6 @@
import { useSystemSettings } from '../system-settings';
export const useAdminSchemaUid = () => {
const ctx = useSystemSettings();
return ctx?.data?.data?.options?.adminSchemaUid;
};

View File

@ -14,6 +14,7 @@ import {
findByUid,
findMenuItem,
useACLRoleContext,
useAdminSchemaUid,
useDocumentTitle,
useRequest,
useSystemSettings,
@ -54,11 +55,6 @@ const useMenuProps = () => {
};
};
const useAdminSchemaUid = () => {
const ctx = useSystemSettings();
return ctx?.data?.data?.options?.adminSchemaUid;
};
const MenuEditor = (props) => {
const { setTitle } = useDocumentTitle();
const navigate = useNavigate();