Placeholder CM tags working

This commit is contained in:
Gregory Schier
2024-09-02 12:35:05 -07:00
parent f8b317e94b
commit 0bfafb284a
13 changed files with 163 additions and 59 deletions

View File

@@ -0,0 +1,15 @@
import { useMutation } from '@tanstack/react-query';
import type { HttpResponse } from '@yaakapp/api';
import { useCopy } from '../hooks/useCopy';
import { getResponseBodyText } from '../lib/responseBody';
export function useCopyHttpResponse(response: HttpResponse) {
const copy = useCopy();
return useMutation({
mutationKey: ['copy_http_response'],
async mutationFn() {
const body = await getResponseBodyText(response);
copy(body);
},
});
}