<script>
import { userStore } from '@/PiniaStores/UserStore.js'
export default {
  data() {
    return {
      locals:[],
      userStore_:userStore(),
    }
  },
  beforeMount() {
     fetch(`http://localhost:8080/api/customer/favourite-locals`,{
      method: 'GET',
      headers: {
        'Authorization': this.userStore_.getToken
      }
    })
      .then(res => res.json())
      .then(data => this.locals = data)
      .catch(err => console.log(err))
  },
}
</script>

<template>
  <div id="container " class="border container-xxl" v-for="local in locals" :key="local">
    <h3>{{local.name}}</h3>
    <h3>{{local.address}}</h3>
  </div>
</template>

<style scoped></style>
