Redesign home page
This commit is contained in:
1 parent
e3863058a0
commit
2977c73a10
31 files changed
+587
-161
No files matched your search
@@ -0,0 +1,36 @@
|
||||
import { useLocalStorage } from "@vueuse/core";
|
||||
import { defineStore } from "pinia";
|
||||
import { TourModel } from "../models/tourModel";
|
||||
import { getAllTours } from "../api/tourApi";
|
||||
import { GenreModel } from "../models/genreModel";
|
||||
import { getAllBands } from "../api/bandApi";
|
||||
import { BandModel } from "../models/bandModel";
|
||||
import { LocationModel } from "../models/locationModel";
|
||||
import { getAllLocations } from "../api/locationApi";
|
||||
|
||||
export const useShowStore = defineStore("showStore", {
|
||||
state: () => ({
|
||||
tours: useLocalStorage<Array<TourModel>>("hackmycart/showStore/tours", []),
|
||||
bands: useLocalStorage<Array<BandModel>>("hackmycart/showStore/bands", []),
|
||||
locations: useLocalStorage<Array<LocationModel>>("hackmycart/showStore/locations", [])
|
||||
}),
|
||||
|
||||
actions: {
|
||||
async fetchAllTours() {
|
||||
await getAllTours()
|
||||
.then(result => {
|
||||
this.tours = result.data
|
||||
})
|
||||
|
||||
await getAllBands()
|
||||
.then(result => {
|
||||
this.bands = result.data
|
||||
})
|
||||
|
||||
await getAllLocations()
|
||||
.then(result => {
|
||||
this.locations = result.data
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,21 +0,0 @@
|
||||
import { useLocalStorage } from "@vueuse/core";
|
||||
import { defineStore } from "pinia";
|
||||
import { TourModel } from "../models/tourModel";
|
||||
import { getAllTours } from "../api/tourApi";
|
||||
import { GenreModel } from "../models/genreModel";
|
||||
|
||||
export const useTourStore = defineStore("tourStore", {
|
||||
state: () => ({
|
||||
tours: useLocalStorage<Array<TourModel>>("hackmycart/tourStore/tours", []),
|
||||
genres: useLocalStorage<Array<GenreModel>>("hackmycart/tourStore/genres", [])
|
||||
}),
|
||||
|
||||
actions: {
|
||||
async fetchAllTours() {
|
||||
await getAllTours()
|
||||
.then(result => {
|
||||
this.tours = result.data
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user