mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-07-10 06:42:52 +02:00
Improve response history menu (#492)
This commit is contained in:
@@ -9,10 +9,12 @@ import { invokeCmd } from "../lib/tauri";
|
||||
import { showToast } from "../lib/toast";
|
||||
import { useFastMutation } from "./useFastMutation";
|
||||
|
||||
export function useSaveResponse(response: HttpResponse) {
|
||||
export function useSaveResponse(response: HttpResponse | null) {
|
||||
return useFastMutation({
|
||||
mutationKey: ["save_response", response.id],
|
||||
mutationKey: ["save_response", response?.id],
|
||||
mutationFn: async () => {
|
||||
if (response == null) return null;
|
||||
|
||||
const request = getModel("http_request", response.requestId);
|
||||
if (request == null) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user