import type { CourseType } from '../types'
import { getCourseList } from '../api'

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

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