♻️ Fully typed API

This commit is contained in:
2025-09-19 01:21:38 +08:00
parent 7904ce9ca7
commit 60e8b1dcfb
13 changed files with 276 additions and 26 deletions

View File

@@ -1,14 +1,15 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { useSolarNetwork } from '~/composables/useSolarNetwork'
import type { SnPublisher } from '~/types/api'
export const usePubStore = defineStore('pub', () => {
const publishers = ref<any[]>([])
const publishers = ref<SnPublisher[]>([])
async function fetchPublishers() {
const api = useSolarNetwork()
const resp = await api('/publishers')
publishers.value = resp as any[]
publishers.value = resp as SnPublisher[]
}
return { publishers, fetchPublishers }