import { getBatchData } from '@/service/index/api'
import { useUserStore } from '@/store/user'

export const getPhaseLine = () => {
  let phaseLine = ref(0)
  const userStore = useUserStore()
  getBatchData(userStore.userInfo.batchDataUrl).then((res) => {
    if (res.code === 200) {
      phaseLine.value = res.result[0].batches.find(
        (item) => item.batch === userStore.userInfo.batchName,
      ).score
    }
  })

  return { phaseLine }
}
