chorse: changed api data to stored locally

This commit is contained in:
2024-04-08 22:20:18 +02:00
parent 26fd0c67e4
commit 31302cc053
6 changed files with 1439 additions and 38 deletions
+3 -3
View File
@@ -149,9 +149,9 @@ export default defineComponent({
},
computedCargoData() {
if (!this.store.vehiclesAPIData?.generator.cargo) return [];
if (!this.store.vehiclesData?.generator.cargo) return [];
const cargoGeneratorData = this.store.vehiclesAPIData.generator.cargo;
const cargoGeneratorData = this.store.vehiclesData.generator.cargo;
return Object.keys(cargoGeneratorData)
.sort((v1, v2) => this.$t(`cargo.${v1}`).localeCompare(this.$t(`cargo.${v2}`)))
@@ -195,7 +195,7 @@ export default defineComponent({
generateStock(empty = false) {
const generatedChosenStockList = this.chosenCargoTypes.reduce(
(acc, type) => {
this.store.vehiclesAPIData?.generator.cargo[type]
this.store.vehiclesData?.generator.cargo[type]
.filter((c) => !this.excludedCarTypes.includes(c.split(':')[0]))
.forEach((c) => {
const [type, cargoType] = c.split(':');