forked from verdnatura/salix-front
24 lines
503 B
JavaScript
24 lines
503 B
JavaScript
import { defineStore } from 'pinia';
|
|
import travelService from 'src/services/travel.service';
|
|
|
|
export const useTravelStore = defineStore({
|
|
id: 'travel',
|
|
|
|
state: () => ({
|
|
initialDataLoading: true,
|
|
travels: [],
|
|
}),
|
|
actions: {
|
|
async init() {
|
|
await this.fetchAllData();
|
|
},
|
|
|
|
async fetchAllData() {
|
|
const { data } = await travelService.getTravels();
|
|
this.travels = data || [];
|
|
},
|
|
},
|
|
|
|
getters: {},
|
|
});
|