floder-type.ts 431 B

1234567891011121314
  1. import { ref } from 'vue'
  2. import { fetchFloderTypes } from '@/api'
  3. import type { FloderTypes, FloderType } from '@/api'
  4. export const floderTypes = ref<FloderTypes>([])
  5. export const getFloderType = (id: FloderType['filesTypeId']) =>
  6. floderTypes.value.find(type => type.filesTypeId === id)
  7. export const initialFloderTypes = async () => {
  8. floderTypes.value = await fetchFloderTypes()
  9. }
  10. export type { FloderType, FloderTypes }