urukhai
urukhai

Reputation: 95

Fetch and xhr API requests with Nuxt 2

I have a Nuxt 2 project. When I make a single API request, in the Network tab it is doubled: one as fetch type and one as xhr type. Am I missing some settings in nuxt.config.js?

 export default {  
  computed: {
    ...mapGetters({
      averageAttendances: 'dashboard/stats/averageAttendances',
      averageAbsences: 'dashboard/stats/averageAbsences'          
    })
  },
  fetch() {
    this.fetchStats()
  },
  methods: {
    ...mapActions({
      fetchStats: 'dashboard/stats/fetchStats'
    })
  }
}

enter image description here

Upvotes: 0

Views: 43

Answers (0)

Related Questions