mirror of
https://github.com/directus/directus.git
synced 2026-01-30 14:58:07 -05:00
* Fix ability to change M2O field type and prevent incompatible interfaces in advanced mode * Removed unused imports * Rename interface variable
14 lines
535 B
TypeScript
14 lines
535 B
TypeScript
import { shallowRef, Ref } from 'vue';
|
|
import { InterfaceConfig } from '@directus/shared/types';
|
|
|
|
const interfacesRaw: Ref<InterfaceConfig[]> = shallowRef([]);
|
|
const interfaces: Ref<InterfaceConfig[]> = shallowRef([]);
|
|
|
|
export function getInterfaces(): { interfaces: Ref<InterfaceConfig[]>; interfacesRaw: Ref<InterfaceConfig[]> } {
|
|
return { interfaces, interfacesRaw };
|
|
}
|
|
|
|
export function getInterface(name?: string | null): InterfaceConfig | undefined {
|
|
return !name ? undefined : interfaces.value.find(({ id }) => id === name);
|
|
}
|