fix(openapi-ts): replace api call with generated api client
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user