import { getCourseList } from '../api'

export interface CourseType {
  id: string
  name: string
}

const courses = ref<CourseType[]>([])

export function useGetCourseList() {
  !courses.value.length &&
    getCourseList().then((res: any) => {
      courses.value = res.data
    })
  return { courses }
}
