Redesign home page
This commit is contained in:
@@ -3,13 +3,13 @@ import { MemberModel } from "./memberModel"
|
||||
import { RatingModel } from "./ratingModel"
|
||||
|
||||
export class BandModel {
|
||||
id: Number
|
||||
id: number
|
||||
name: string
|
||||
foundingYear: Number
|
||||
descriptionEn: String
|
||||
descriptionDe: String
|
||||
images: Array<String>
|
||||
logo: String
|
||||
foundingYear: number
|
||||
descriptionEn: string
|
||||
descriptionDe: string
|
||||
images: Array<string>
|
||||
logo: string
|
||||
genre: GenreModel
|
||||
ratings: Array<RatingModel>
|
||||
members: Array<MemberModel>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { CityModel } from "./cityModel"
|
||||
|
||||
export class LocationModel {
|
||||
id: Number
|
||||
name: String
|
||||
address: String
|
||||
id: number
|
||||
name: string
|
||||
address: string
|
||||
city: CityModel
|
||||
image: String
|
||||
image: string
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import { AccountModel } from "./accountModel"
|
||||
import { BandModel } from "./bandModel"
|
||||
|
||||
export class RatingModel {
|
||||
id: Number
|
||||
rating: Number
|
||||
id: number
|
||||
rating: number
|
||||
band: BandModel
|
||||
}
|
||||
36
software/src/data/stores/showStore.ts
Normal file
36
software/src/data/stores/showStore.ts
Normal 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
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -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