fix(openapi-ts): replace api call with generated api client

This commit is contained in:
2026-05-23 19:51:08 +02:00
parent f1afb2096f
commit 43b314bb20
6 changed files with 29 additions and 24 deletions
+5 -5
View File
@@ -1,11 +1,11 @@
import { defineStore } from 'pinia'
import { ref, computed } from 'vue'
import type { SteamCollectionItem } from '@/types'
import { submissionsApiListPuzzles } from '@/api'
import type { SteamCollectionItem } from '@/types'
export const usePuzzlesStore = defineStore('puzzles', () => {
// State
const puzzles = ref<any[]>([])
const puzzles = ref<SteamCollectionItem[]>([])
const isLoading = ref(false)
const error = ref<string>('')
@@ -14,7 +14,7 @@ export const usePuzzlesStore = defineStore('puzzles', () => {
const findPuzzleByName = computed(() => (name: string): SteamCollectionItem | null => {
if (!name) return null
// First try exact match (case insensitive)
const exactMatch = puzzles.value.find(
puzzle => puzzle.title.toLowerCase() === name.toLowerCase()
@@ -26,7 +26,7 @@ export const usePuzzlesStore = defineStore('puzzles', () => {
puzzle => puzzle.title.toLowerCase().includes(name.toLowerCase()) ||
name.toLowerCase().includes(puzzle.title.toLowerCase())
)
return partialMatch || null
})
@@ -46,7 +46,7 @@ export const usePuzzlesStore = defineStore('puzzles', () => {
}
if (response.data) {
puzzles.value = response.data
puzzles.value = response.data as unknown as SteamCollectionItem[]
}
} catch (err) {
error.value = 'Failed to load puzzles'