refactor: hook name should start with 'use'
This commit is contained in:
		
							parent
							
								
									fe652bf6e8
								
							
						
					
					
						commit
						bc25467027
					
				@ -19,7 +19,7 @@ export const TableBlockDesigner = () => {
 | 
			
		||||
  const sortFields = useSortFields(name);
 | 
			
		||||
  const { service } = useTableBlockContext();
 | 
			
		||||
  const { t } = useTranslation();
 | 
			
		||||
  const { dn, refresh } = useDesignable();
 | 
			
		||||
  const { dn } = useDesignable();
 | 
			
		||||
  const defaultFilter = fieldSchema?.['x-decorator-props']?.params?.filter || {};
 | 
			
		||||
  const defaultSort = fieldSchema?.['x-decorator-props']?.params?.sort || [];
 | 
			
		||||
  const defaultResource = fieldSchema?.['x-decorator-props']?.resource;
 | 
			
		||||
 | 
			
		||||
@ -19,9 +19,9 @@ const supportsType = [
 | 
			
		||||
  'multipleSelect',
 | 
			
		||||
  'oho',
 | 
			
		||||
  'obo',
 | 
			
		||||
  'm2o'
 | 
			
		||||
  'm2o',
 | 
			
		||||
];
 | 
			
		||||
const VariableTypes = (currentCollection) => {
 | 
			
		||||
const useVariableTypes = (currentCollection) => {
 | 
			
		||||
  const { getCollectionFields, getInterface, getCollection } = useCollectionManager();
 | 
			
		||||
  const collection = getCollection(currentCollection);
 | 
			
		||||
  const fields = getCollectionFields(currentCollection);
 | 
			
		||||
@ -91,7 +91,7 @@ const VariableTypes = (currentCollection) => {
 | 
			
		||||
 | 
			
		||||
export function useVariableOptions(collectionName) {
 | 
			
		||||
  const compile = useCompile();
 | 
			
		||||
  const options = VariableTypes(collectionName).map((item: any) => {
 | 
			
		||||
  const options = useVariableTypes(collectionName).map((item) => {
 | 
			
		||||
    const options = typeof item.options === 'function' ? item.options() : item.options;
 | 
			
		||||
    return {
 | 
			
		||||
      label: compile(item.title),
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user