mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-21 16:01:46 +01:00
Copy as curl
This commit is contained in:
1 parent
82e2a6b73e
commit
88ee60c97f
32 files changed
+4352
-507
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import { writeText } from '@tauri-apps/plugin-clipboard-manager';
|
||||
|
||||
export function useCopyAsCurl(requestId: string) {
|
||||
return useMutation<string>({
|
||||
mutationFn: async () => {
|
||||
const cmd: string = await invoke('cmd_request_to_curl', { requestId });
|
||||
await writeText(cmd);
|
||||
return cmd;
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user