refactor typów danych

This commit is contained in:
2023-11-10 15:04:49 +01:00
parent e82b4b8817
commit f8b4ce103f
84 changed files with 1011 additions and 1173 deletions
+3 -3
View File
@@ -50,8 +50,8 @@
<script lang="ts">
import { PropType, defineComponent } from 'vue';
import { useStore } from '../../store/store';
import { RollingStockInfo } from '../../scripts/interfaces/github_api/StockInfoGithubData';
import { useStore } from '../../store/mainStore';
import { API } from '../../typings/api';
export default defineComponent({
props: {
@@ -71,7 +71,7 @@ export default defineComponent({
onImageError(event: Event, stockName: string) {
const fallbackName =
Object.keys(this.store.rollingStockData!.info).find((type) => {
return this.store.rollingStockData!.info[type as keyof RollingStockInfo].find(
return this.store.rollingStockData!.info[type as keyof API.RollingStock.Info].find(
(v) => v[0] === stockName.split(':')[0]
);
}) || 'vehicle-unknown';