fix(openapi-ts): first pass for replacing with openapi-ts
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref, computed } from 'vue'
|
||||
import type { SteamCollectionItem } from '@/types'
|
||||
import { apiService } from '@/services/apiService'
|
||||
import { submissionsApiListPuzzles } from '@/api'
|
||||
|
||||
export const usePuzzlesStore = defineStore('puzzles', () => {
|
||||
// State
|
||||
const puzzles = ref<SteamCollectionItem[]>([])
|
||||
const puzzles = ref<any[]>([])
|
||||
const isLoading = ref(false)
|
||||
const error = ref<string>('')
|
||||
|
||||
@@ -33,18 +33,18 @@ export const usePuzzlesStore = defineStore('puzzles', () => {
|
||||
// Actions
|
||||
const loadPuzzles = async () => {
|
||||
if (puzzles.value.length > 0) return // Already loaded
|
||||
|
||||
|
||||
try {
|
||||
isLoading.value = true
|
||||
error.value = ''
|
||||
|
||||
const response = await apiService.getPuzzles()
|
||||
|
||||
const response = await submissionsApiListPuzzles()
|
||||
if (response.error) {
|
||||
error.value = response.error
|
||||
error.value = String(response.error)
|
||||
console.error('Failed to load puzzles:', response.error)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
if (response.data) {
|
||||
puzzles.value = response.data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user