mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-20 00:51:20 +00:00
* feat(client): wire up API client and react-query Add ApiClient class, auth middleware placeholder, feed query, and wrap the app in QueryClientProvider. Co-authored-by: Ona <no-reply@ona.com> * fix(client): append base url on api client req Co-authored-by: Ona <no-reply@ona.com> * fix(client): allow req middlewares to run on empty init * fix(client): rm unused private route declr * fix(client): handle empty url in client.request Co-authored-by: ona-patrol <ona@nym.sh> --------- Co-authored-by: Ona <no-reply@ona.com> Co-authored-by: ona-patrol <ona@nym.sh>
14 lines
334 B
TypeScript
14 lines
334 B
TypeScript
import { queryOptions } from "@tanstack/react-query"
|
|
|
|
import { useApiClient } from "@/api/client"
|
|
|
|
import { FeedItem } from "./types"
|
|
|
|
export function useFeedQuery() {
|
|
const api = useApiClient()
|
|
return queryOptions({
|
|
queryKey: ["feed"],
|
|
queryFn: async () => api.request<{ items: FeedItem[] }>("/feed?render=json-render"),
|
|
})
|
|
}
|