import { ref } from 'vue';

import { getSurveysPage } from '@/api/home';
import { surveyAnalysis } from '@/api/survey';

export const surveys = ref(await getSurveysPage({
  page: 1,
  per_page: 3,
  group_id: 0
}));

console.log(`hooks`, surveys.value.data.data);

surveys.value.data.data.forEach(item => {
  surveyAnalysis(item.sn, {
    page: 1,
    per_page: 30,
    group_id: 0
  }).then(res => {
    console.log(item.sn, res);
  });
});