0
0
Fork 0
salix-front-mindshore-fork2/src/stores/travel.js

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: {},
});