Redesign home page

This commit is contained in:
2024-09-27 15:52:22 +02:00
parent c6c8cf0ae8
commit ef0c48ae17
31 changed files with 587 additions and 161 deletions

View File

@@ -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
})
}
}
})

View File

@@ -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
})
}
}
})