Initial
All checks were successful
Deploy / build (push) Successful in 49s

This commit is contained in:
alsaze
2025-11-19 20:49:25 +03:00
commit 3d975d6884
36 changed files with 27229 additions and 0 deletions

2
api/queries/index.ts Normal file
View File

@@ -0,0 +1,2 @@
export * from './useGetPosts'
export * from './useGetUsers'

View File

@@ -0,0 +1,10 @@
import { useQuery } from '@tanstack/vue-query'
import { getPosts } from '~/api/endpoints'
export const useGetPosts = (search: MaybeRef<string>) => {
return useQuery<Posts>({
queryKey: ['get-posts', search],
queryFn: () => getPosts(unref(search)),
staleTime: Infinity,
})
}

View File

@@ -0,0 +1,10 @@
import { useQuery } from '@tanstack/vue-query'
import { getUsers } from '~/api/endpoints'
export const useGetUsers = () => {
return useQuery<Users>({
queryKey: ['get-users'],
queryFn: () => getUsers(),
staleTime: Infinity,
})
}