Feat/metadata datatable types (#2175)
* Handled new url v2 type * Fixed refetch queries * wip * Ok delete but views bug * Fix lint --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
18
front/src/modules/metadata/hooks/useMetadataObject.ts
Normal file
18
front/src/modules/metadata/hooks/useMetadataObject.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { useAvailableScopeIdOrThrow } from '@/ui/utilities/recoil-scope/scopes-internal/hooks/useAvailableScopeId';
|
||||
|
||||
import { MetadataObjectScopeInternalContext } from '../scopes/scope-internal-context/MetadataObjectScopeInternalContext';
|
||||
|
||||
type UseMetadataObjectProps = {
|
||||
metadataObjectNamePlural?: string;
|
||||
};
|
||||
|
||||
export const useMetadataObject = (props?: UseMetadataObjectProps) => {
|
||||
const scopeId = useAvailableScopeIdOrThrow(
|
||||
MetadataObjectScopeInternalContext,
|
||||
props?.metadataObjectNamePlural,
|
||||
);
|
||||
|
||||
return {
|
||||
scopeId,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user