mirror of
https://github.com/gotson/komga.git
synced 2025-12-14 04:22:27 +01:00
14 lines
415 B
TypeScript
14 lines
415 B
TypeScript
import {defineQuery, useQuery} from '@pinia/colada'
|
|
import {komgaClient} from '@/api/komga-client'
|
|
|
|
export const useAppReleases = defineQuery(() => {
|
|
return useQuery({
|
|
key: () => ['app-releases'],
|
|
query: () => komgaClient.GET('/api/v1/releases')
|
|
// unwrap the openapi-fetch structure on success
|
|
.then((res) => res.data),
|
|
// 1 hour
|
|
staleTime: 60 * 60 * 1000,
|
|
gcTime: false,
|
|
})
|
|
})
|