Last change
on this file was c3d3266, checked in by Aleksandarj03 <138524804+Aleksandarj03@…>, 3 months ago |
Ne rabote fetcho
|
-
Property mode
set to
100644
|
File size:
683 bytes
|
Rev | Line | |
---|
[c3d3266] | 1 | <script>
|
---|
| 2 | import { userStore } from '@/PiniaStores/UserStore.js'
|
---|
| 3 | export default {
|
---|
| 4 | data() {
|
---|
| 5 | return {
|
---|
| 6 | locals:[],
|
---|
| 7 | userStore_:userStore(),
|
---|
| 8 | }
|
---|
| 9 | },
|
---|
| 10 | beforeMount() {
|
---|
| 11 | fetch(`http://localhost:8080/api/customer/favourite-locals`,{
|
---|
| 12 | method: 'GET',
|
---|
| 13 | headers: {
|
---|
| 14 | 'Authorization': this.userStore_.getToken
|
---|
| 15 | }
|
---|
| 16 | })
|
---|
| 17 | .then(res => res.json())
|
---|
| 18 | .then(data => this.locals = data)
|
---|
| 19 | .catch(err => console.log(err))
|
---|
| 20 | },
|
---|
| 21 | }
|
---|
[f9ef3e8] | 22 | </script>
|
---|
| 23 |
|
---|
| 24 | <template>
|
---|
[c3d3266] | 25 | <div id="container " class="border container-xxl" v-for="local in locals" :key="local">
|
---|
| 26 | <h3>{{local.name}}</h3>
|
---|
| 27 | <h3>{{local.address}}</h3>
|
---|
[17db9d2] | 28 | </div>
|
---|
[f9ef3e8] | 29 | </template>
|
---|
| 30 |
|
---|
[c3d3266] | 31 | <style scoped></style>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.