mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-05-21 07:07:30 +02:00
f967820f12
- [x] Move from `sqlx` to `rusqlite` - [x] Generate TS types from Rust models
13 lines
439 B
TypeScript
13 lines
439 B
TypeScript
import { useQuery } from '@tanstack/react-query';
|
|
import type { HttpResponse } from '@yaakapp/api';
|
|
import { getResponseBodyBlob } from '../lib/responseBody';
|
|
|
|
export function useResponseBodyBlob(response: HttpResponse) {
|
|
return useQuery<Uint8Array | null>({
|
|
enabled: response != null,
|
|
queryKey: ['response-body-binary', response?.updatedAt],
|
|
initialData: null,
|
|
queryFn: () => getResponseBodyBlob(response),
|
|
}).data;
|
|
}
|