feat/Added basic erd support

This commit is contained in:
Muhammed Mustafa
2022-09-13 23:55:41 +05:30
parent 4884887664
commit e3ef8a8ff0
8 changed files with 693 additions and 1 deletions

View File

@@ -10,6 +10,10 @@ export function useMetas() {
const { tables } = useProject()
const metas = useState<{ [idOrTitle: string]: TableType | any }>('metas', () => ({}))
const metasWithId = computed(() => {
const idEntries = Object.entries(metas.value).filter(([k, v]) => k === v.id)
return Object.fromEntries(idEntries)
})
const loadingState = useState<Record<string, boolean>>('metas-loading-state', () => ({}))
const setMeta = async (model: any) => {
@@ -91,5 +95,5 @@ export function useMetas() {
}
}
return { getMeta, clearAllMeta, metas, removeMeta, setMeta }
return { getMeta, clearAllMeta, metas, metasWithId, removeMeta, setMeta }
}